diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index d8260b0..71adff7 100644
a
|
b
|
The URL where requests are redirected after login when the
|
1303 | 1303 | This is used by the :func:`~django.contrib.auth.decorators.login_required` |
1304 | 1304 | decorator, for example. |
1305 | 1305 | |
| 1306 | .. _`note on LOGIN_REDIRECT_URL setting`: |
| 1307 | |
| 1308 | .. note:: |
| 1309 | You can use :func:`~django.core.urlresolvers.reverse_lazy` to reference |
| 1310 | URLs by their name instead of providing hardcoded value:: |
| 1311 | |
| 1312 | # urls.py |
| 1313 | urlpatterns = patterns('', |
| 1314 | url(_(r'^home/$'), 'test_app.views.home', name='home'), |
| 1315 | ) |
| 1316 | |
| 1317 | # settings.py |
| 1318 | LOGIN_REDIRECT_URL = reverse_lazy('home') |
| 1319 | |
| 1320 | This also works fine with localized URLs using :func:`~django.conf.urls.i18n.i18n_patterns`. |
| 1321 | |
1306 | 1322 | .. setting:: LOGIN_URL |
1307 | 1323 | |
1308 | 1324 | LOGIN_URL |
… |
… |
Default: ``'/accounts/login/'``
|
1313 | 1329 | The URL where requests are redirected for login, especially when using the |
1314 | 1330 | :func:`~django.contrib.auth.decorators.login_required` decorator. |
1315 | 1331 | |
| 1332 | .. note:: |
| 1333 | See the `note on LOGIN_REDIRECT_URL setting`_ |
| 1334 | |
1316 | 1335 | .. setting:: LOGOUT_URL |
1317 | 1336 | |
1318 | 1337 | LOGOUT_URL |
… |
… |
Default: ``'/accounts/logout/'``
|
1322 | 1341 | |
1323 | 1342 | LOGIN_URL counterpart. |
1324 | 1343 | |
| 1344 | .. note:: |
| 1345 | See the `note on LOGIN_REDIRECT_URL setting`_ |
| 1346 | |
1325 | 1347 | .. setting:: MANAGERS |
1326 | 1348 | |
1327 | 1349 | MANAGERS |
diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt
index 29ee851..fe90bbc 100644
a
|
b
|
reverse_lazy()
|
880 | 880 | |
881 | 881 | A lazily evaluated version of `reverse()`_. |
882 | 882 | |
| 883 | .. function:: reverse_lazy(viewname, [urlconf=None, args=None, kwargs=None, current_app=None]) |
| 884 | |
883 | 885 | It is useful for when you need to use a URL reversal before your project's |
884 | 886 | URLConf is loaded. Some common cases where this function is necessary are: |
885 | 887 | |