diff --git a/cotisations/views.py b/cotisations/views.py index e0d3c5ea..fcff76b7 100644 --- a/cotisations/views.py +++ b/cotisations/views.py @@ -2,8 +2,8 @@ # Goulven Kermarec, Gabriel Détraz # Gplv2 from django.shortcuts import render, redirect -from django.shortcuts import render_to_response, get_object_or_404 -from django.core.context_processors import csrf +from django.shortcuts import get_object_or_404 +from django.template.context_processors import csrf from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.template import Context, RequestContext, loader from django.contrib.auth.decorators import login_required, permission_required @@ -28,7 +28,7 @@ from django.utils import timezone def form(ctx, template, request): c = ctx c.update(csrf(request)) - return render_to_response(template, c, context_instance=RequestContext(request)) + return render(request, template, c) def create_cotis(vente, user, duration, date_start=False): """ Update et crée l'objet cotisation associé à une facture, prend en argument l'user, la facture pour la quantitéi, et l'article pour la durée""" diff --git a/logs/views.py b/logs/views.py index 4d5c7f9c..116e8350 100644 --- a/logs/views.py +++ b/logs/views.py @@ -3,8 +3,8 @@ # Gplv2 from django.http import HttpResponse from django.shortcuts import render, redirect -from django.shortcuts import render_to_response, get_object_or_404 -from django.core.context_processors import csrf +from django.shortcuts import get_object_or_404 +from django.template.context_processors import csrf from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.template import Context, RequestContext, loader from django.contrib import messages @@ -39,7 +39,7 @@ STATS_DICT = { def form(ctx, template, request): c = ctx c.update(csrf(request)) - return render_to_response(template, c, context_instance=RequestContext(request)) + return render(request, template, c) @login_required @permission_required('cableur') diff --git a/machines/views.py b/machines/views.py index 63c18856..71d9ff42 100644 --- a/machines/views.py +++ b/machines/views.py @@ -3,8 +3,8 @@ # Gplv2 from django.http import HttpResponse from django.shortcuts import render, redirect -from django.shortcuts import render_to_response, get_object_or_404 -from django.core.context_processors import csrf +from django.shortcuts import get_object_or_404 +from django.template.context_processors import csrf from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.template import Context, RequestContext, loader from django.contrib import messages @@ -81,7 +81,7 @@ def unassign_ipv4(interface): def form(ctx, template, request): c = ctx c.update(csrf(request)) - return render_to_response(template, c, context_instance=RequestContext(request)) + return render(request, template, c) @login_required def new_machine(request, userid): diff --git a/re2o/settings.py b/re2o/settings.py index f5ecccb1..7cf10b42 100644 --- a/re2o/settings.py +++ b/re2o/settings.py @@ -79,7 +79,7 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', - 'django.core.context_processors.request', + 'django.template.context_processors.request', 're2o.context_processors.context_user', ], }, diff --git a/re2o/views.py b/re2o/views.py index 0fef2c0b..cfcc19e5 100644 --- a/re2o/views.py +++ b/re2o/views.py @@ -1,13 +1,13 @@ from django.shortcuts import render -from django.shortcuts import render_to_response, get_object_or_404 -from django.core.context_processors import csrf +from django.shortcuts import get_object_or_404 +from django.template.context_processors import csrf from django.template import Context, RequestContext, loader from re2o.settings import services_urls def form(ctx, template, request): c = ctx c.update(csrf(request)) - return render_to_response(template, c, context_instance=RequestContext(request)) + return render(request, template, c) def index(request): diff --git a/search/views.py b/search/views.py index adbe4b65..75b899ec 100644 --- a/search/views.py +++ b/search/views.py @@ -3,7 +3,7 @@ # Gplv2 from django.shortcuts import render from django.shortcuts import render_to_response, get_object_or_404 -from django.core.context_processors import csrf +from django.template.context_processors import csrf from django.template import Context, RequestContext, loader from django.contrib.auth.decorators import login_required diff --git a/templates/registration/login.html b/templates/registration/login.html index 02f00ba1..4455ba54 100644 --- a/templates/registration/login.html +++ b/templates/registration/login.html @@ -19,7 +19,7 @@ {% endif %} {% endif %} -