diff options
| author | darkryder <sambhav13085@iiitd.ac.in> | 2015-01-21 22:25:57 +0530 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-02-03 14:59:45 -0500 |
| commit | 9ec8aa5e5d42ac4529846f7eae6bf4982800abff (patch) | |
| tree | 6a1195ff3831031f8207e18e4dcf69015fb4c50c /docs/howto | |
| parent | 570912a97d5051fa3aeacd9d16c3be9afcf92198 (diff) | |
Fixed #24149 -- Normalized tuple settings to lists.
Diffstat (limited to 'docs/howto')
| -rw-r--r-- | docs/howto/auth-remote-user.txt | 8 | ||||
| -rw-r--r-- | docs/howto/error-reporting.txt | 10 | ||||
| -rw-r--r-- | docs/howto/static-files/index.txt | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/docs/howto/auth-remote-user.txt b/docs/howto/auth-remote-user.txt index 07389c1fac..53ed929511 100644 --- a/docs/howto/auth-remote-user.txt +++ b/docs/howto/auth-remote-user.txt @@ -31,20 +31,20 @@ First, you must add the :setting:`MIDDLEWARE_CLASSES` setting **after** the :class:`django.contrib.auth.middleware.AuthenticationMiddleware`:: - MIDDLEWARE_CLASSES = ( + MIDDLEWARE_CLASSES = [ '...', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.RemoteUserMiddleware', '...', - ) + ] Next, you must replace the :class:`~django.contrib.auth.backends.ModelBackend` with :class:`~django.contrib.auth.backends.RemoteUserBackend` in the :setting:`AUTHENTICATION_BACKENDS` setting:: - AUTHENTICATION_BACKENDS = ( + AUTHENTICATION_BACKENDS = [ 'django.contrib.auth.backends.RemoteUserBackend', - ) + ] With this setup, ``RemoteUserMiddleware`` will detect the username in ``request.META['REMOTE_USER']`` and will authenticate and auto-login that user diff --git a/docs/howto/error-reporting.txt b/docs/howto/error-reporting.txt index 521acf59d3..e71419ba37 100644 --- a/docs/howto/error-reporting.txt +++ b/docs/howto/error-reporting.txt @@ -73,14 +73,14 @@ those are usually just people typing in broken URLs or broken Web 'bots). Put it towards the top of your :setting:`MIDDLEWARE_CLASSES` setting. You can tell Django to stop reporting particular 404s by tweaking the -:setting:`IGNORABLE_404_URLS` setting. It should be a tuple of compiled +:setting:`IGNORABLE_404_URLS` setting. It should be a list of compiled regular expression objects. For example:: import re - IGNORABLE_404_URLS = ( + IGNORABLE_404_URLS = [ re.compile(r'\.(php|cgi)$'), re.compile(r'^/phpmyadmin/'), - ) + ] In this example, a 404 to any URL ending with ``.php`` or ``.cgi`` will *not* be reported. Neither will any URL starting with ``/phpmyadmin/``. @@ -89,11 +89,11 @@ The following example shows how to exclude some conventional URLs that browsers crawlers often request:: import re - IGNORABLE_404_URLS = ( + IGNORABLE_404_URLS = [ re.compile(r'^/apple-touch-icon.*\.png$'), re.compile(r'^/favicon\.ico$'), re.compile(r'^/robots\.txt$'), - ) + ] (Note that these are regular expressions, so we put a backslash in front of periods to escape them.) diff --git a/docs/howto/static-files/index.txt b/docs/howto/static-files/index.txt index f9fd390ef0..3185b5fdca 100644 --- a/docs/howto/static-files/index.txt +++ b/docs/howto/static-files/index.txt @@ -55,10 +55,10 @@ particular app. In addition to using a ``static/`` directory inside your apps, you can define a list of directories (:setting:`STATICFILES_DIRS`) in your settings file where Django will also look for static files. For example:: - STATICFILES_DIRS = ( + STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), '/var/www/static/', - ) + ] See the documentation for the :setting:`STATICFILES_FINDERS` setting for details on how ``staticfiles`` finds your files. |
