From 10f979fd92000de1ac9713351f5cb749e2cbca03 Mon Sep 17 00:00:00 2001 From: Simon Meers Date: Fri, 3 Aug 2012 10:03:52 +1000 Subject: [PATCH] Fixed #18700 -- Added URL reversal for i18n set_language view. --- django/conf/urls/i18n.py | 4 ++-- docs/topics/i18n/translation.txt | 2 +- tests/regressiontests/views/tests/i18n.py | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/django/conf/urls/i18n.py b/django/conf/urls/i18n.py index 6e56af82710..426c2b2d30e 100644 --- a/django/conf/urls/i18n.py +++ b/django/conf/urls/i18n.py @@ -1,5 +1,5 @@ from django.conf import settings -from django.conf.urls import patterns +from django.conf.urls import patterns, url from django.core.urlresolvers import LocaleRegexURLResolver def i18n_patterns(prefix, *args): @@ -16,5 +16,5 @@ def i18n_patterns(prefix, *args): urlpatterns = patterns('', - (r'^setlang/$', 'django.views.i18n.set_language'), + url(r'^setlang/$', 'django.views.i18n.set_language', name='set_language'), ) diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index 988948e259b..bdbb04823d5 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -1272,7 +1272,7 @@ Here's example HTML template code: .. code-block:: html+django -
+ {% csrf_token %}