Remove unused code
This commit is contained in:
parent
b55b5504d7
commit
83ca957263
1 changed files with 1 additions and 11 deletions
|
@ -23,9 +23,8 @@ from django.http import (
|
||||||
)
|
)
|
||||||
from django.middleware.gzip import re_accepts_gzip
|
from django.middleware.gzip import re_accepts_gzip
|
||||||
from django.shortcuts import get_object_or_404
|
from django.shortcuts import get_object_or_404
|
||||||
from django.template.loader import render_to_string
|
|
||||||
from django.urls import reverse, reverse_lazy
|
from django.urls import reverse, reverse_lazy
|
||||||
from django.utils.encoding import force_bytes, smart_bytes
|
from django.utils.encoding import smart_bytes
|
||||||
from django.utils.http import http_date
|
from django.utils.http import http_date
|
||||||
from django.utils.translation import gettext as _
|
from django.utils.translation import gettext as _
|
||||||
from django.utils.translation import to_locale
|
from django.utils.translation import to_locale
|
||||||
|
@ -329,15 +328,6 @@ def _urls_for_js(urls=None):
|
||||||
return urls
|
return urls
|
||||||
|
|
||||||
|
|
||||||
def render_to_json(templates, context, request):
|
|
||||||
"""
|
|
||||||
Generate a JSON HttpResponse with rendered template HTML.
|
|
||||||
"""
|
|
||||||
html = render_to_string(templates, context=context, request=request)
|
|
||||||
_json = json.dumps({"html": html})
|
|
||||||
return HttpResponse(_json)
|
|
||||||
|
|
||||||
|
|
||||||
def simple_json_response(**kwargs):
|
def simple_json_response(**kwargs):
|
||||||
return HttpResponse(json.dumps(kwargs))
|
return HttpResponse(json.dumps(kwargs))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue