summaryrefslogtreecommitdiff
path: root/docs/topics
diff options
context:
space:
mode:
Diffstat (limited to 'docs/topics')
-rw-r--r--docs/topics/auth/customizing.txt4
-rw-r--r--docs/topics/auth/passwords.txt12
-rw-r--r--docs/topics/cache.txt4
-rw-r--r--docs/topics/db/models.txt4
-rw-r--r--docs/topics/http/file-uploads.txt4
-rw-r--r--docs/topics/http/middleware.txt6
-rw-r--r--docs/topics/i18n/translation.txt14
-rw-r--r--docs/topics/testing/overview.txt4
8 files changed, 26 insertions, 26 deletions
diff --git a/docs/topics/auth/customizing.txt b/docs/topics/auth/customizing.txt
index d75b4b6cb8..3833328cf2 100644
--- a/docs/topics/auth/customizing.txt
+++ b/docs/topics/auth/customizing.txt
@@ -52,13 +52,13 @@ all of its authentication backends. If the first authentication method fails,
Django tries the second one, and so on, until all backends have been attempted.
The list of authentication backends to use is specified in the
-:setting:`AUTHENTICATION_BACKENDS` setting. This should be a tuple of Python
+:setting:`AUTHENTICATION_BACKENDS` setting. This should be a list of Python
path names that point to Python classes that know how to authenticate. These
classes can be anywhere on your Python path.
By default, :setting:`AUTHENTICATION_BACKENDS` is set to::
- ('django.contrib.auth.backends.ModelBackend',)
+ ['django.contrib.auth.backends.ModelBackend']
That's the basic authentication backend that checks the Django users database
and queries the built-in permissions. It does not provide protection against
diff --git a/docs/topics/auth/passwords.txt b/docs/topics/auth/passwords.txt
index ee41c4bcdb..910d08fabe 100644
--- a/docs/topics/auth/passwords.txt
+++ b/docs/topics/auth/passwords.txt
@@ -49,7 +49,7 @@ first in the list.
The default for :setting:`PASSWORD_HASHERS` is::
- PASSWORD_HASHERS = (
+ PASSWORD_HASHERS = [
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
@@ -57,7 +57,7 @@ The default for :setting:`PASSWORD_HASHERS` is::
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
- )
+ ]
This means that Django will use PBKDF2_ to store all passwords, but will support
checking passwords stored with PBKDF2SHA1, bcrypt_, SHA1_, etc. The next few
@@ -83,7 +83,7 @@ To use Bcrypt as your default storage algorithm, do the following:
2. Modify :setting:`PASSWORD_HASHERS` to list ``BCryptSHA256PasswordHasher``
first. That is, in your settings file, you'd put::
- PASSWORD_HASHERS = (
+ PASSWORD_HASHERS = [
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
'django.contrib.auth.hashers.BCryptPasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
@@ -91,7 +91,7 @@ To use Bcrypt as your default storage algorithm, do the following:
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
- )
+ ]
(You need to keep the other entries in this list, or else Django won't
be able to upgrade passwords; see below).
@@ -154,7 +154,7 @@ default PBKDF2 algorithm:
2. Add your new hasher as the first entry in :setting:`PASSWORD_HASHERS`::
- PASSWORD_HASHERS = (
+ PASSWORD_HASHERS = [
'myproject.hashers.MyPBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
@@ -163,7 +163,7 @@ default PBKDF2 algorithm:
'django.contrib.auth.hashers.SHA1PasswordHasher',
'django.contrib.auth.hashers.MD5PasswordHasher',
'django.contrib.auth.hashers.CryptPasswordHasher',
- )
+ ]
That's it -- now your Django install will use more iterations when it
diff --git a/docs/topics/cache.txt b/docs/topics/cache.txt
index d6c5c56f6f..5cdb18e615 100644
--- a/docs/topics/cache.txt
+++ b/docs/topics/cache.txt
@@ -437,11 +437,11 @@ entire site. You'll need to add
``'django.middleware.cache.FetchFromCacheMiddleware'`` to your
:setting:`MIDDLEWARE_CLASSES` setting, as in this example::
- MIDDLEWARE_CLASSES = (
+ MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
- )
+ ]
.. note::
diff --git a/docs/topics/db/models.txt b/docs/topics/db/models.txt
index 9decc9ebef..2a9193c805 100644
--- a/docs/topics/db/models.txt
+++ b/docs/topics/db/models.txt
@@ -70,11 +70,11 @@ For example, if the models for your application live in the module
application by the :djadmin:`manage.py startapp <startapp>` script),
:setting:`INSTALLED_APPS` should read, in part::
- INSTALLED_APPS = (
+ INSTALLED_APPS = [
#...
'myapp',
#...
- )
+ ]
When you add new apps to :setting:`INSTALLED_APPS`, be sure to run
:djadmin:`manage.py migrate <migrate>`, optionally making migrations
diff --git a/docs/topics/http/file-uploads.txt b/docs/topics/http/file-uploads.txt
index f07c27679a..ea01dfc88e 100644
--- a/docs/topics/http/file-uploads.txt
+++ b/docs/topics/http/file-uploads.txt
@@ -132,8 +132,8 @@ handler* -- a small class that handles file data as it gets uploaded. Upload
handlers are initially defined in the :setting:`FILE_UPLOAD_HANDLERS` setting,
which defaults to::
- ("django.core.files.uploadhandler.MemoryFileUploadHandler",
- "django.core.files.uploadhandler.TemporaryFileUploadHandler",)
+ ["django.core.files.uploadhandler.MemoryFileUploadHandler",
+ "django.core.files.uploadhandler.TemporaryFileUploadHandler"]
Together :class:`MemoryFileUploadHandler` and
:class:`TemporaryFileUploadHandler` provide Django's default file upload
diff --git a/docs/topics/http/middleware.txt b/docs/topics/http/middleware.txt
index 7e1e01dd87..cd03870c31 100644
--- a/docs/topics/http/middleware.txt
+++ b/docs/topics/http/middleware.txt
@@ -20,21 +20,21 @@ Activating middleware
=====================
To activate a middleware component, add it to the
-:setting:`MIDDLEWARE_CLASSES` tuple in your Django settings.
+:setting:`MIDDLEWARE_CLASSES` list in your Django settings.
In :setting:`MIDDLEWARE_CLASSES`, each middleware component is represented by
a string: the full Python path to the middleware's class name. For example,
here's the default value created by :djadmin:`django-admin startproject
<startproject>`::
- MIDDLEWARE_CLASSES = (
+ MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
- )
+ ]
A Django installation doesn't require any middleware —
:setting:`MIDDLEWARE_CLASSES` can be empty, if you'd like — but it's strongly
diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt
index 7da54127cf..8eaa248bcb 100644
--- a/docs/topics/i18n/translation.txt
+++ b/docs/topics/i18n/translation.txt
@@ -848,7 +848,7 @@ information for a list of languages (e.g. active languages as specified in
view <set_language-redirect-view>` for an example of how to display a language
selector using ``{% get_language_info_list %}``.
-In addition to :setting:`LANGUAGES` style nested tuples,
+In addition to :setting:`LANGUAGES` style list of tuples,
``{% get_language_info_list %}`` supports simple lists of language codes.
If you do this in your view:
@@ -1684,11 +1684,11 @@ matters, you should follow these guidelines:
For example, your :setting:`MIDDLEWARE_CLASSES` might look like this::
- MIDDLEWARE_CLASSES = (
+ MIDDLEWARE_CLASSES = [
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
- )
+ ]
(For more on middleware, see the :doc:`middleware documentation
</topics/http/middleware>`.)
@@ -1734,10 +1734,10 @@ Notes:
languages (because your application doesn't provide all those languages),
set :setting:`LANGUAGES` to a list of languages. For example::
- LANGUAGES = (
+ LANGUAGES = [
('de', _('German')),
('en', _('English')),
- )
+ ]
This example restricts languages that are available for automatic
selection to German and English (and any sublanguage, like de-ch or
@@ -1752,10 +1752,10 @@ Notes:
from django.utils.translation import ugettext_lazy as _
- LANGUAGES = (
+ LANGUAGES = [
('de', _('German')),
('en', _('English')),
- )
+ ]
Once ``LocaleMiddleware`` determines the user's preference, it makes this
preference available as ``request.LANGUAGE_CODE`` for each
diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt
index ac1c4b550e..cee2f2c1fe 100644
--- a/docs/topics/testing/overview.txt
+++ b/docs/topics/testing/overview.txt
@@ -320,9 +320,9 @@ design. If during your tests you are authenticating many users, you may want
to use a custom settings file and set the :setting:`PASSWORD_HASHERS` setting
to a faster hashing algorithm::
- PASSWORD_HASHERS = (
+ PASSWORD_HASHERS = [
'django.contrib.auth.hashers.MD5PasswordHasher',
- )
+ ]
Don't forget to also include in :setting:`PASSWORD_HASHERS` any hashing
algorithm used in fixtures, if any.