diff --git a/core/views_logbooks.py b/core/views_logbooks.py index dcc26f8..1ef7838 100644 --- a/core/views_logbooks.py +++ b/core/views_logbooks.py @@ -6,7 +6,7 @@ import django.db.models from django.db.models import Min, Max from django.urls import reverse from django.http import HttpResponse, HttpResponseRedirect -from django.shortcuts import render, render_to_response +from django.shortcuts import render from django.template import Context, loader from django.template.defaultfilters import slugify from django.utils import timezone @@ -31,6 +31,7 @@ import troggle.settings as settings # to each template. So we use a custom method, render_response # instead of render_to_response. Hopefully future Django releases # will make this unnecessary. + # from troggle.alwaysUseRequestContext import render_response # Deprecated in 1.11.29 diff --git a/core/views_logbooks2.py b/core/views_logbooks2.py index d79bbd3..a38806a 100644 --- a/core/views_logbooks2.py +++ b/core/views_logbooks2.py @@ -6,7 +6,7 @@ import django.db.models from django.db.models import Min, Max from django.urls import reverse from django.http import HttpResponse, HttpResponseRedirect -from django.shortcuts import render, render_to_response +from django.shortcuts import render from django.template import Context, loader from django.template.defaultfilters import slugify from django.utils import timezone @@ -31,6 +31,7 @@ import troggle.settings as settings # to each template. So we use a custom method, render_response # instead of render_to_response. Hopefully future Django releases # will make this unnecessary. + # from troggle.alwaysUseRequestContext import render_response # Deprecated in 1.11.29 diff --git a/core/views_other.py b/core/views_other.py index 67726cc..0b3e6c3 100644 --- a/core/views_other.py +++ b/core/views_other.py @@ -29,7 +29,7 @@ def troggle404(request): # cannot get this to work. Handler404 in urls.py not ri ''' context = RequestContext(request) #context['caves'] = Cave.objects.all() - return render_to_response('404.html', context.flatten()) + return render(request, ('404.html', context.flatten())) def showrequest(request): return HttpResponse(request.GET) diff --git a/core/views_statistics.py b/core/views_statistics.py index 45b963c..3102d51 100644 --- a/core/views_statistics.py +++ b/core/views_statistics.py @@ -5,7 +5,7 @@ from collections import OrderedDict import django.db.models from django.db.models import Min, Max -from django.shortcuts import render, render_to_response +from django.shortcuts import render from django.template import Context, loader from django.template.defaultfilters import slugify from django.utils import timezone diff --git a/core/views_survex.py b/core/views_survex.py index 9bec952..ef554aa 100644 --- a/core/views_survex.py +++ b/core/views_survex.py @@ -5,12 +5,9 @@ import difflib from pathlib import Path from django import forms -from django.http import HttpResponseRedirect, HttpResponse -from django.template import RequestContext -from django.shortcuts import render_to_response, render -#from django.core.context_processors import csrf +from django.http import HttpResponseRedirect, HttpResponse, Http404 +from django.shortcuts import render from django.template.context_processors import csrf -from django.http import HttpResponse, Http404 from django.views.decorators.csrf import ensure_csrf_cookie from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned @@ -382,8 +379,6 @@ def survexcavesingle(request, survex_cave): kataster numbers are not unique across areas. Fix this. ''' sc = survex_cave - context = RequestContext(request) - context_dict = {} try: cave = Cave.objects.get(kataster_number=sc) # This may not be unique. return render(request, 'svxcavesingle.html', {'settings': settings, "cave":cave })