12
Here's a full list of all available settings, in alphabetical order, and their
15
.. setting:: ABSOLUTE_URL_OVERRIDES
17
ABSOLUTE_URL_OVERRIDES
18
----------------------
20
Default: ``{}`` (Empty dictionary)
22
A dictionary mapping ``"app_label.model_name"`` strings to functions that take
23
a model object and return its URL. This is a way of overriding
24
``get_absolute_url()`` methods on a per-installation basis. Example::
26
ABSOLUTE_URL_OVERRIDES = {
27
'blogs.weblog': lambda o: "/blogs/%s/" % o.slug,
28
'news.story': lambda o: "/stories/%s/%s/" % (o.pub_year, o.slug),
31
Note that the model name used in this setting should be all lower-case, regardless
32
of the case of the actual model class name.
34
.. setting:: ADMIN_FOR
39
Default: ``()`` (Empty tuple)
41
Used for admin-site settings modules, this should be a tuple of settings
42
modules (in the format ``'foo.bar.baz'``) for which this site is an admin.
44
The admin site uses this in its automatically-introspected documentation of
45
models, views and template tags.
47
.. setting:: ADMIN_MEDIA_PREFIX
52
Default: ``'/static/admin/'``
54
The URL prefix for admin media -- CSS, JavaScript and images used by the Django
55
administrative interface. Make sure to use a trailing slash, and to have this be
56
different from the :setting:`MEDIA_URL` setting (since the same URL cannot be
57
mapped onto two different sets of files). For integration with :doc:`staticfiles
58
</ref/contrib/staticfiles>`, this should be the same as
59
:setting:`STATIC_URL` followed by ``'admin/'``.
66
Default: ``()`` (Empty tuple)
68
A tuple that lists people who get code error notifications. When
69
``DEBUG=False`` and a view raises an exception, Django will e-mail these people
70
with the full exception information. Each member of the tuple should be a tuple
71
of (Full name, e-mail address). Example::
73
(('John', 'john@example.com'), ('Mary', 'mary@example.com'))
75
Note that Django will e-mail *all* of these people whenever an error happens.
76
See :doc:`/howto/error-reporting` for more information.
78
.. setting:: ALLOWED_INCLUDE_ROOTS
83
Default: ``()`` (Empty tuple)
85
A tuple of strings representing allowed prefixes for the ``{% ssi %}`` template
86
tag. This is a security measure, so that template authors can't access files
87
that they shouldn't be accessing.
89
For example, if ``ALLOWED_INCLUDE_ROOTS`` is ``('/home/html', '/var/www')``,
90
then ``{% ssi /home/html/foo.txt %}`` would work, but ``{% ssi /etc/passwd %}``
93
.. setting:: APPEND_SLASH
100
When set to ``True``, if the request URL does not match any of the patterns
101
in the URLconf and it doesn't end in a slash, an HTTP redirect is issued to the
102
same URL with a slash appended. Note that the redirect may cause any data
103
submitted in a POST request to be lost.
105
The ``APPEND_SLASH`` setting is only used if
106
:class:`~django.middleware.common.CommonMiddleware` is installed
107
(see :doc:`/topics/http/middleware`). See also :setting:`PREPEND_WWW`.
109
.. setting:: AUTHENTICATION_BACKENDS
111
AUTHENTICATION_BACKENDS
112
-----------------------
114
Default: ``('django.contrib.auth.backends.ModelBackend',)``
116
A tuple of authentication backend classes (as strings) to use when attempting to
117
authenticate a user. See the :doc:`authentication backends documentation
118
</ref/authbackends>` for details.
120
.. setting:: AUTH_PROFILE_MODULE
127
The site-specific user profile model used by this site. See
128
:ref:`auth-profiles`.
135
.. versionadded:: 1.3
141
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
145
A dictionary containing the settings for all caches to be used with
146
Django. It is a nested dictionary whose contents maps cache aliases
147
to a dictionary containing the options for an individual cache.
149
The :setting:`CACHES` setting must configure a ``default`` cache;
150
any number of additional caches may also be specified. If you
151
are using a cache backend other than the local memory cache, or
152
you need to define multiple caches, other options will be required.
153
The following cache options are available.
155
.. setting:: CACHES-BACKEND
160
Default: ``''`` (Empty string)
162
The cache backend to use. The built-in cache backends are:
164
* ``'django.core.cache.backends.db.DatabaseCache'``
165
* ``'django.core.cache.backends.dummy.DummyCache'``
166
* ``'django.core.cache.backends.filebased.FileBasedCache'``
167
* ``'django.core.cache.backends.locmem.LocMemCache'``
168
* ``'django.core.cache.backends.memcached.MemcachedCache'``
169
* ``'django.core.cache.backends.memcached.PyLibMCCache'``
171
You can use a cache backend that doesn't ship with Django by setting
172
:setting:`BACKEND <CACHE-BACKEND>` to a fully-qualified path of a cache
173
backend class (i.e. ``mypackage.backends.whatever.WhateverCache``).
174
Writing a whole new cache backend from scratch is left as an exercise
175
to the reader; see the other backends for examples.
178
Prior to Django 1.3, you could use a URI based version of the backend
179
name to reference the built-in cache backends (e.g., you could use
180
``'db://tablename'`` to refer to the database backend). This format has
181
been deprecated, and will be removed in Django 1.5.
183
.. setting:: CACHES-KEY_FUNCTION
188
A string containing a dotted path to a function that defines how to
189
compose a prefix, version and key into a final cache key. The default
190
implementation is equivalent to the function::
192
def make_key(key, key_prefix, version):
193
return ':'.join([key_prefix, str(version), smart_str(key)])
195
You may use any key function you want, as long as it has the same
198
See the :ref:`cache documentation <cache_key_transformation>` for more information.
200
.. setting:: CACHES-KEY_PREFIX
205
Default: ``''`` (Empty string)
207
A string that will be automatically included (prepended by default) to
208
all cache keys used by the Django server.
210
See the :ref:`cache documentation <cache_key_prefixing>` for more information.
212
.. setting:: CACHES-LOCATION
217
Default: ``''`` (Empty string)
219
The location of the cache to use. This might be the directory for a
220
file system cache, a host and port for a memcache server, or simply an
221
identifying name for a local memory cache. e.g.::
225
'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
226
'LOCATION': '/var/tmp/django_cache',
230
.. setting:: CACHES-OPTIONS
237
Extra parameters to pass to the cache backend. Available parameters
238
vary depending on your cache backend.
240
Some information on available parameters can be found in the
241
:doc:`Cache Backends </topics/cache>` documentation. For more information,
242
consult your backend module's own documentation.
244
.. setting:: CACHES-TIMEOUT
251
The number of seconds before a cache entry is considered stale.
253
.. setting:: CACHES-VERSION
260
The default version number for cache keys generated by the Django server.
262
See the :ref:`cache documentation <cache_versioning>` for more information.
264
.. setting:: CACHE_MIDDLEWARE_ALIAS
266
CACHE_MIDDLEWARE_ALIAS
267
----------------------
271
The cache connection to use for the cache middleware.
273
.. setting:: CACHE_MIDDLEWARE_ANONYMOUS_ONLY
275
CACHE_MIDDLEWARE_ANONYMOUS_ONLY
276
-------------------------------
280
If the value of this setting is ``True``, only anonymous requests (i.e., not
281
those made by a logged-in user) will be cached. Otherwise, the middleware
282
caches every page that doesn't have GET or POST parameters.
284
If you set the value of this setting to ``True``, you should make sure you've
285
activated ``AuthenticationMiddleware``.
287
See :doc:`/topics/cache`.
289
.. setting:: CACHE_MIDDLEWARE_KEY_PREFIX
291
CACHE_MIDDLEWARE_KEY_PREFIX
292
---------------------------
294
Default: ``''`` (Empty string)
296
The cache key prefix that the cache middleware should use.
298
See :doc:`/topics/cache`.
300
.. setting:: CACHE_MIDDLEWARE_SECONDS
302
CACHE_MIDDLEWARE_SECONDS
303
------------------------
307
The default number of seconds to cache a page when the caching middleware or
308
``cache_page()`` decorator is used.
310
See :doc:`/topics/cache`.
312
.. setting:: CSRF_COOKIE_DOMAIN
317
.. versionadded:: 1.2
321
The domain to be used when setting the CSRF cookie. This can be useful for
322
allowing cross-subdomain requests to be exluded from the normal cross site
323
request forgery protection. It should be set to a string such as
324
``".lawrence.com"`` to allow a POST request from a form on one subdomain to be
325
accepted by accepted by a view served from another subdomain.
327
.. setting:: CSRF_COOKIE_NAME
332
.. versionadded:: 1.2
334
Default: ``'csrftoken'``
336
The name of the cookie to use for the CSRF authentication token. This can be whatever you
337
want. See :doc:`/ref/contrib/csrf`.
339
.. setting:: CSRF_FAILURE_VIEW
344
.. versionadded:: 1.2
346
Default: ``'django.views.csrf.csrf_failure'``
348
A dotted path to the view function to be used when an incoming request
349
is rejected by the CSRF protection. The function should have this signature::
351
def csrf_failure(request, reason="")
353
where ``reason`` is a short message (intended for developers or logging, not for
354
end users) indicating the reason the request was rejected. See
355
:doc:`/ref/contrib/csrf`.
358
.. setting:: DATABASES
363
.. versionadded:: 1.2
365
Default: ``{}`` (Empty dictionary)
367
A dictionary containing the settings for all databases to be used with
368
Django. It is a nested dictionary whose contents maps database aliases
369
to a dictionary containing the options for an individual database.
371
The :setting:`DATABASES` setting must configure a ``default`` database;
372
any number of additional databases may also be specified.
374
The simplest possible settings file is for a single-database setup using
375
SQLite. This can be configured using the following::
379
'ENGINE': 'django.db.backends.sqlite3',
384
For other database backends, or more complex SQLite configurations, other options
385
will be required. The following inner options are available.
387
.. setting:: DATABASE-ENGINE
392
Default: ``''`` (Empty string)
394
The database backend to use. The built-in database backends are:
396
* ``'django.db.backends.postgresql_psycopg2'``
397
* ``'django.db.backends.postgresql'``
398
* ``'django.db.backends.mysql'``
399
* ``'django.db.backends.sqlite3'``
400
* ``'django.db.backends.oracle'``
402
You can use a database backend that doesn't ship with Django by setting
403
``ENGINE`` to a fully-qualified path (i.e.
404
``mypackage.backends.whatever``). Writing a whole new database backend from
405
scratch is left as an exercise to the reader; see the other backends for
409
Prior to Django 1.2, you could use a short version of the backend name
410
to reference the built-in database backends (e.g., you could use
411
``'sqlite3'`` to refer to the SQLite backend). This format has been
412
deprecated, and will be removed in Django 1.4.
419
Default: ``''`` (Empty string)
421
Which host to use when connecting to the database. An empty string means
422
localhost. Not used with SQLite.
424
If this value starts with a forward slash (``'/'``) and you're using MySQL,
425
MySQL will connect via a Unix socket to the specified socket. For example::
427
"HOST": '/var/run/mysql'
429
If you're using MySQL and this value *doesn't* start with a forward slash, then
430
this value is assumed to be the host.
432
If you're using PostgreSQL, an empty string means to use a Unix domain socket
433
for the connection, rather than a network connection to localhost. If you
434
explicitly need to use a TCP/IP connection on the local machine with
435
PostgreSQL, specify ``localhost`` here.
442
Default: ``''`` (Empty string)
444
The name of the database to use. For SQLite, it's the full path to the database
445
file. When specifying the path, always use forward slashes, even on Windows
446
(e.g. ``C:/homes/user/mysite/sqlite3.db``).
453
Default: ``{}`` (Empty dictionary)
455
Extra parameters to use when connecting to the database. Available parameters
456
vary depending on your database backend.
458
Some information on available parameters can be found in the
459
:doc:`Database Backends </ref/databases>` documentation. For more information,
460
consult your backend module's own documentation.
462
.. setting:: PASSWORD
467
Default: ``''`` (Empty string)
469
The password to use when connecting to the database. Not used with SQLite.
476
Default: ``''`` (Empty string)
478
The port to use when connecting to the database. An empty string means the
479
default port. Not used with SQLite.
486
Default: ``''`` (Empty string)
488
The username to use when connecting to the database. Not used with SQLite.
490
.. setting:: TEST_CHARSET
497
The character set encoding used to create the test database. The value of this
498
string is passed directly through to the database, so its format is
501
Supported for the PostgreSQL_ (``postgresql``, ``postgresql_psycopg2``) and
502
MySQL_ (``mysql``) backends.
504
.. _PostgreSQL: http://www.postgresql.org/docs/8.2/static/multibyte.html
505
.. _MySQL: http://dev.mysql.com/doc/refman/5.0/en/charset-database.html
507
.. setting:: TEST_COLLATION
514
The collation order to use when creating the test database. This value is
515
passed directly to the backend, so its format is backend-specific.
517
Only supported for the ``mysql`` backend (see the `MySQL manual`_ for details).
519
.. _MySQL manual: MySQL_
521
.. setting:: TEST_DEPENDENCIES
526
.. versionadded:: 1.3
528
Default: ``['default']``, for all databases other than ``default``,
529
which has no dependencies.
531
The creation-order dependencies of the database. See the documentation
532
on :ref:`controlling the creation order of test databases
533
<topics-testing-creation-dependencies>` for details.
535
.. setting:: TEST_MIRROR
542
The alias of the database that this database should mirror during
545
This setting exists to allow for testing of master/slave
546
configurations of multiple databases. See the documentation on
547
:ref:`testing master/slave configurations
548
<topics-testing-masterslave>` for details.
550
.. setting:: TEST_NAME
557
The name of database to use when running the test suite.
559
If the default value (``None``) is used with the SQLite database engine, the
560
tests will use a memory resident database. For all other database engines the
561
test database will use the name ``'test_' + DATABASE_NAME``.
563
See :doc:`/topics/testing`.
565
.. setting:: TEST_USER
572
This is an Oracle-specific setting.
574
The username to use when connecting to the Oracle database that will be used
577
.. setting:: DATABASE_ROUTERS
582
.. versionadded:: 1.2
584
Default: ``[]`` (Empty list)
586
The list of routers that will be used to determine which database
587
to use when performing a database queries.
589
See the documentation on :ref:`automatic database routing in multi
590
database configurations <topics-db-multi-db-routing>`.
592
.. setting:: DATE_FORMAT
597
Default: ``'N j, Y'`` (e.g. ``Feb. 4, 2003``)
599
The default formatting to use for displaying date fields in any part of the
600
system. Note that if :setting:`USE_L10N` is set to ``True``, then the
601
locale-dictated format has higher precedence and will be applied instead. See
602
:tfilter:`allowed date format strings <date>`.
604
.. versionchanged:: 1.2
605
This setting can now be overriden by setting ``USE_L10N`` to ``True``.
607
See also ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATE_FORMAT``.
609
.. setting:: DATE_INPUT_FORMATS
614
.. versionadded:: 1.2
618
('%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y',
619
'%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y',
620
'%B %d, %Y', '%d %B %Y', '%d %B, %Y')
622
A tuple of formats that will be accepted when inputting data on a date
623
field. Formats will be tried in order, using the first valid.
624
Note that these format strings are specified in Python's datetime_ module
625
syntax, that is different from the one used by Django for formatting dates
628
See also ``DATETIME_INPUT_FORMATS`` and ``TIME_INPUT_FORMATS``.
630
.. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
632
.. setting:: DATETIME_FORMAT
637
Default: ``'N j, Y, P'`` (e.g. ``Feb. 4, 2003, 4 p.m.``)
639
The default formatting to use for displaying datetime fields in any part of the
640
system. Note that if :setting:`USE_L10N` is set to ``True``, then the
641
locale-dictated format has higher precedence and will be applied instead. See
642
:tfilter:`allowed date format strings <date>`.
644
.. versionchanged:: 1.2
645
This setting can now be overriden by setting ``USE_L10N`` to ``True``.
647
See also ``DATE_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
649
.. setting:: DATETIME_INPUT_FORMATS
651
DATETIME_INPUT_FORMATS
652
----------------------
654
.. versionadded:: 1.2
658
('%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M', '%Y-%m-%d',
659
'%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M', '%m/%d/%Y',
660
'%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M', '%m/%d/%y')
662
A tuple of formats that will be accepted when inputting data on a datetime
663
field. Formats will be tried in order, using the first valid.
664
Note that these format strings are specified in Python's datetime_ module
665
syntax, that is different from the one used by Django for formatting dates
668
See also ``DATE_INPUT_FORMATS`` and ``TIME_INPUT_FORMATS``.
670
.. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
679
A boolean that turns on/off debug mode.
681
If you define custom settings, `django/views/debug.py`_ has a ``HIDDEN_SETTINGS``
682
regular expression which will hide from the DEBUG view anything that contains
683
``'SECRET'``, ``'PASSWORD'``, ``'PROFANITIES'``, or ``'SIGNATURE'``. This allows
684
untrusted users to be able to give backtraces without seeing sensitive (or
687
Still, note that there are always going to be sections of your debug output that
688
are inappropriate for public consumption. File paths, configuration options, and
689
the like all give attackers extra information about your server.
691
It is also important to remember that when running with ``DEBUG`` turned on, Django
692
will remember every SQL query it executes. This is useful when you are debugging,
693
but on a production server, it will rapidly consume memory.
695
Never deploy a site into production with ``DEBUG`` turned on.
697
.. _django/views/debug.py: http://code.djangoproject.com/browser/django/trunk/django/views/debug.py
699
DEBUG_PROPAGATE_EXCEPTIONS
700
--------------------------
704
If set to True, Django's normal exception handling of view functions
705
will be suppressed, and exceptions will propagate upwards. This can
706
be useful for some test setups, and should never be used on a live
709
.. setting:: DECIMAL_SEPARATOR
714
.. versionadded:: 1.2
716
Default: ``'.'`` (Dot)
718
Default decimal separator used when formatting decimal numbers.
720
.. setting:: DEFAULT_CHARSET
727
Default charset to use for all ``HttpResponse`` objects, if a MIME type isn't
728
manually specified. Used with ``DEFAULT_CONTENT_TYPE`` to construct the
729
``Content-Type`` header.
731
.. setting:: DEFAULT_CONTENT_TYPE
736
Default: ``'text/html'``
738
Default content type to use for all ``HttpResponse`` objects, if a MIME type
739
isn't manually specified. Used with ``DEFAULT_CHARSET`` to construct the
740
``Content-Type`` header.
742
.. setting:: DEFAULT_FILE_STORAGE
747
Default: :class:`django.core.files.storage.FileSystemStorage`
749
Default file storage class to be used for any file-related operations that don't
750
specify a particular storage system. See :doc:`/topics/files`.
752
.. setting:: DEFAULT_FROM_EMAIL
757
Default: ``'webmaster@localhost'``
759
Default e-mail address to use for various automated correspondence from the
762
.. setting:: DEFAULT_INDEX_TABLESPACE
764
DEFAULT_INDEX_TABLESPACE
765
------------------------
767
Default: ``''`` (Empty string)
769
Default tablespace to use for indexes on fields that don't specify
770
one, if the backend supports it.
772
.. setting:: DEFAULT_TABLESPACE
777
Default: ``''`` (Empty string)
779
Default tablespace to use for models that don't specify one, if the
782
.. setting:: DISALLOWED_USER_AGENTS
784
DISALLOWED_USER_AGENTS
785
----------------------
787
Default: ``()`` (Empty tuple)
789
List of compiled regular expression objects representing User-Agent strings that
790
are not allowed to visit any page, systemwide. Use this for bad robots/crawlers.
791
This is only used if ``CommonMiddleware`` is installed (see
792
:doc:`/topics/http/middleware`).
794
.. setting:: EMAIL_BACKEND
799
.. versionadded:: 1.2
801
Default: ``'django.core.mail.backends.smtp.EmailBackend'``
803
The backend to use for sending emails. For the list of available backends see
804
:doc:`/topics/email`.
806
.. setting:: EMAIL_FILE_PATH
811
.. versionadded:: 1.2
815
The directory used by the ``file`` email backend to store output files.
817
.. setting:: EMAIL_HOST
822
Default: ``'localhost'``
824
The host to use for sending e-mail.
826
See also ``EMAIL_PORT``.
828
.. setting:: EMAIL_HOST_PASSWORD
833
Default: ``''`` (Empty string)
835
Password to use for the SMTP server defined in ``EMAIL_HOST``. This setting is
836
used in conjunction with ``EMAIL_HOST_USER`` when authenticating to the SMTP
837
server. If either of these settings is empty, Django won't attempt
840
See also ``EMAIL_HOST_USER``.
842
.. setting:: EMAIL_HOST_USER
847
Default: ``''`` (Empty string)
849
Username to use for the SMTP server defined in ``EMAIL_HOST``. If empty,
850
Django won't attempt authentication.
852
See also ``EMAIL_HOST_PASSWORD``.
854
.. setting:: EMAIL_PORT
861
Port to use for the SMTP server defined in ``EMAIL_HOST``.
863
.. setting:: EMAIL_SUBJECT_PREFIX
868
Default: ``'[Django] '``
870
Subject-line prefix for e-mail messages sent with ``django.core.mail.mail_admins``
871
or ``django.core.mail.mail_managers``. You'll probably want to include the
874
.. setting:: EMAIL_USE_TLS
881
Whether to use a TLS (secure) connection when talking to the SMTP server.
883
.. setting:: FILE_CHARSET
890
The character encoding used to decode any files read from disk. This includes
891
template files and initial SQL data files.
893
.. setting:: FILE_UPLOAD_HANDLERS
900
("django.core.files.uploadhandler.MemoryFileUploadHandler",
901
"django.core.files.uploadhandler.TemporaryFileUploadHandler",)
903
A tuple of handlers to use for uploading. See :doc:`/topics/files` for details.
905
.. setting:: FILE_UPLOAD_MAX_MEMORY_SIZE
907
FILE_UPLOAD_MAX_MEMORY_SIZE
908
---------------------------
910
Default: ``2621440`` (i.e. 2.5 MB).
912
The maximum size (in bytes) that an upload will be before it gets streamed to
913
the file system. See :doc:`/topics/files` for details.
915
.. setting:: FILE_UPLOAD_PERMISSIONS
917
FILE_UPLOAD_PERMISSIONS
918
-----------------------
922
The numeric mode (i.e. ``0644``) to set newly uploaded files to. For
923
more information about what these modes mean, see the `documentation for
926
If this isn't given or is ``None``, you'll get operating-system
927
dependent behavior. On most platforms, temporary files will have a mode
928
of ``0600``, and files saved from memory will be saved using the
929
system's standard umask.
933
**Always prefix the mode with a 0.**
935
If you're not familiar with file modes, please note that the leading
936
``0`` is very important: it indicates an octal number, which is the
937
way that modes must be specified. If you try to use ``644``, you'll
938
get totally incorrect behavior.
941
.. _documentation for os.chmod: http://docs.python.org/library/os.html#os.chmod
943
.. setting:: FILE_UPLOAD_TEMP_DIR
950
The directory to store data temporarily while uploading files. If ``None``,
951
Django will use the standard temporary directory for the operating system. For
952
example, this will default to '/tmp' on \*nix-style operating systems.
954
See :doc:`/topics/files` for details.
956
.. setting:: FIRST_DAY_OF_WEEK
961
.. versionadded:: 1.2
963
Default: ``0`` (Sunday)
965
Number representing the first day of the week. This is especially useful
966
when displaying a calendar. This value is only used when not using
967
format internationalization, or when a format cannot be found for the
970
The value must be an integer from 0 to 6, where 0 means Sunday, 1 means
973
.. setting:: FIXTURE_DIRS
978
Default: ``()`` (Empty tuple)
980
List of locations of the fixture data files, in search order. Note that
981
these paths should use Unix-style forward slashes, even on Windows. See
982
:doc:`/topics/testing`.
989
If not ``None``, this will be used as the value of the ``SCRIPT_NAME``
990
environment variable in any HTTP request. This setting can be used to override
991
the server-provided value of ``SCRIPT_NAME``, which may be a rewritten version
992
of the preferred value or not supplied at all.
994
.. setting:: FORMAT_MODULE_PATH
999
.. versionadded:: 1.2
1003
A full Python path to a Python package that contains format definitions for
1004
project locales. If not ``None``, Django will check for a ``formats.py``
1005
file, under the directory named as the current locale, and will use the
1006
formats defined on this file.
1008
For example, if ``FORMAT_MODULE_PATH`` is set to ``mysite.formats``, and
1009
current language is ``en`` (English), Django will expect a directory tree
1019
Available formats are ``DATE_FORMAT``, ``TIME_FORMAT``, ``DATETIME_FORMAT``,
1020
``YEAR_MONTH_FORMAT``, ``MONTH_DAY_FORMAT``, ``SHORT_DATE_FORMAT``,
1021
``SHORT_DATETIME_FORMAT``, ``FIRST_DAY_OF_WEEK``, ``DECIMAL_SEPARATOR``,
1022
``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``.
1024
.. setting:: IGNORABLE_404_ENDS
1029
Default: ``('mail.pl', 'mailform.pl', 'mail.cgi', 'mailform.cgi', 'favicon.ico', '.php')``
1031
See also ``IGNORABLE_404_STARTS`` and ``Error reporting via e-mail``.
1033
.. setting:: IGNORABLE_404_STARTS
1035
IGNORABLE_404_STARTS
1036
--------------------
1038
Default: ``('/cgi-bin/', '/_vti_bin', '/_vti_inf')``
1040
A tuple of strings that specify beginnings of URLs that should be ignored by
1041
the 404 e-mailer. See ``SEND_BROKEN_LINK_EMAILS``, ``IGNORABLE_404_ENDS`` and
1042
the :doc:`/howto/error-reporting`.
1044
.. setting:: INSTALLED_APPS
1049
Default: ``()`` (Empty tuple)
1051
A tuple of strings designating all applications that are enabled in this Django
1052
installation. Each string should be a full Python path to a Python package that
1053
contains a Django application, as created by :djadmin:`django-admin.py startapp
1056
.. admonition:: App names must be unique
1058
The application names (that is, the final dotted part of the
1059
path to the module containing ``models.py``) defined in
1060
:setting:`INSTALLED_APPS` *must* be unique. For example, you can't
1061
include both ``django.contrib.auth`` and ``myproject.auth`` in
1064
.. setting:: INTERNAL_IPS
1069
Default: ``()`` (Empty tuple)
1071
A tuple of IP addresses, as strings, that:
1073
* See debug comments, when ``DEBUG`` is ``True``
1074
* Receive X headers if the ``XViewMiddleware`` is installed (see
1075
:doc:`/topics/http/middleware`)
1077
.. setting:: LANGUAGE_CODE
1082
Default: ``'en-us'``
1084
A string representing the language code for this installation. This should be in
1085
standard :term:`language format<language code>`. For example, U.S. English is
1086
``"en-us"``. See :doc:`/topics/i18n/index`.
1088
.. setting:: LANGUAGE_COOKIE_NAME
1090
LANGUAGE_COOKIE_NAME
1091
--------------------
1093
Default: ``'django_language'``
1095
The name of the cookie to use for the language cookie. This can be whatever you
1096
want (but should be different from ``SESSION_COOKIE_NAME``). See
1097
:doc:`/topics/i18n/index`.
1099
.. setting:: LANGUAGES
1104
Default: A tuple of all available languages. This list is continually growing
1105
and including a copy here would inevitably become rapidly out of date. You can
1106
see the current list of translated languages by looking in
1107
``django/conf/global_settings.py`` (or view the `online source`_).
1109
.. _online source: http://code.djangoproject.com/browser/django/trunk/django/conf/global_settings.py
1111
The list is a tuple of two-tuples in the format ``(language code, language
1112
name)``, the ``language code`` part should be a
1113
:term:`language name<language code>` -- for example, ``('ja', 'Japanese')``.
1114
This specifies which languages are available for language selection. See
1115
:doc:`/topics/i18n/index`.
1117
Generally, the default value should suffice. Only set this setting if you want
1118
to restrict language selection to a subset of the Django-provided languages.
1120
If you define a custom ``LANGUAGES`` setting, it's OK to mark the languages as
1121
translation strings (as in the default value referred to above) -- but use a
1122
"dummy" ``gettext()`` function, not the one in ``django.utils.translation``.
1123
You should *never* import ``django.utils.translation`` from within your
1124
settings file, because that module in itself depends on the settings, and that
1125
would cause a circular import.
1127
The solution is to use a "dummy" ``gettext()`` function. Here's a sample
1130
gettext = lambda s: s
1133
('de', gettext('German')),
1134
('en', gettext('English')),
1137
With this arrangement, ``django-admin.py makemessages`` will still find and
1138
mark these strings for translation, but the translation won't happen at
1139
runtime -- so you'll have to remember to wrap the languages in the *real*
1140
``gettext()`` in any code that uses ``LANGUAGES`` at runtime.
1142
.. setting:: LOCALE_PATHS
1147
Default: ``()`` (Empty tuple)
1149
A tuple of directories where Django looks for translation files.
1150
See :ref:`using-translations-in-your-own-projects`.
1155
'/home/www/project/common_files/locale',
1156
'/var/local/translations/locale'
1159
Note that in the paths you add to the value of this setting, if you have the
1160
typical ``/path/to/locale/xx/LC_MESSAGES`` hierarchy, you should use the path to
1161
the ``locale`` directory (i.e. ``'/path/to/locale'``).
1163
.. setting:: LOGGING
1168
.. versionadded:: 1.3
1170
Default: A logging configuration dictionary.
1172
A data structure containing configuration information. The contents of
1173
this data structure will be passed as the argument to the
1174
configuration method described in :setting:`LOGGING_CONFIG`.
1176
The default logging configuration passes HTTP 500 server errors to an
1177
email log handler; all other log messages are given to a NullHandler.
1179
.. setting:: LOGGING_CONFIG
1184
.. versionadded:: 1.3
1186
Default: ``'django.utils.log.dictConfig'``
1188
A path to a callable that will be used to configure logging in the
1189
Django project. Points at a instance of Python's `dictConfig`_
1190
configuration method by default.
1192
If you set :setting:`LOGGING_CONFIG` to ``None``, the logging
1193
configuration process will be skipped.
1195
.. _dictConfig: http://docs.python.org/library/logging.html#logging.dictConfig
1197
.. setting:: LOGIN_REDIRECT_URL
1202
Default: ``'/accounts/profile/'``
1204
The URL where requests are redirected after login when the
1205
``contrib.auth.login`` view gets no ``next`` parameter.
1207
This is used by the :func:`~django.contrib.auth.decorators.login_required`
1208
decorator, for example.
1210
.. setting:: LOGIN_URL
1215
Default: ``'/accounts/login/'``
1217
The URL where requests are redirected for login, especially when using the
1218
:func:`~django.contrib.auth.decorators.login_required` decorator.
1220
.. setting:: LOGOUT_URL
1225
Default: ``'/accounts/logout/'``
1227
LOGIN_URL counterpart.
1229
.. setting:: MANAGERS
1234
Default: ``()`` (Empty tuple)
1236
A tuple in the same format as ``ADMINS`` that specifies who should get
1237
broken-link notifications when ``SEND_BROKEN_LINK_EMAILS=True``.
1239
.. setting:: MEDIA_ROOT
1244
Default: ``''`` (Empty string)
1246
Absolute path to the directory that holds media for this installation, used
1247
for :doc:`managing stored files </topics/files>`.
1249
Example: ``"/home/media/media.lawrence.com/"``
1251
See also :setting:`MEDIA_URL`.
1253
.. setting:: MEDIA_URL
1258
Default: ``''`` (Empty string)
1260
URL that handles the media served from :setting:`MEDIA_ROOT`, used
1261
for :doc:`managing stored files </topics/files>`.
1263
Example: ``"http://media.lawrence.com/"``
1265
.. versionchanged:: 1.3
1266
It must end in a slash if set to a non-empty value.
1271
.. versionadded:: 1.2
1273
Default: `messages.INFO`
1275
Sets the minimum message level that will be recorded by the messages
1276
framework. See the :doc:`messages documentation </ref/contrib/messages>` for
1282
.. versionadded:: 1.2
1284
Default: ``'django.contrib.messages.storage.user_messages.LegacyFallbackStorage'``
1286
Controls where Django stores message data. See the
1287
:doc:`messages documentation </ref/contrib/messages>` for more details.
1292
.. versionadded:: 1.2
1296
{messages.DEBUG: 'debug',
1297
messages.INFO: 'info',
1298
messages.SUCCESS: 'success',
1299
messages.WARNING: 'warning',
1300
messages.ERROR: 'error',}
1302
Sets the mapping of message levels to message tags. See the
1303
:doc:`messages documentation </ref/contrib/messages>` for more details.
1305
.. setting:: MIDDLEWARE_CLASSES
1312
('django.middleware.common.CommonMiddleware',
1313
'django.contrib.sessions.middleware.SessionMiddleware',
1314
'django.middleware.csrf.CsrfViewMiddleware',
1315
'django.contrib.auth.middleware.AuthenticationMiddleware',
1316
'django.contrib.messages.middleware.MessageMiddleware',)
1318
A tuple of middleware classes to use. See :doc:`/topics/http/middleware`.
1320
.. versionchanged:: 1.2
1321
``'django.contrib.messages.middleware.MessageMiddleware'`` was added to the
1322
default. For more information, see the :doc:`messages documentation
1323
</ref/contrib/messages>`.
1325
.. setting:: MONTH_DAY_FORMAT
1332
The default formatting to use for date fields on Django admin change-list
1333
pages -- and, possibly, by other parts of the system -- in cases when only the
1334
month and day are displayed.
1336
For example, when a Django admin change-list page is being filtered by a date
1337
drilldown, the header for a given day displays the day and month. Different
1338
locales have different formats. For example, U.S. English would say
1339
"January 1," whereas Spanish might say "1 Enero."
1341
See :tfilter:`allowed date format strings <date>`. See also ``DATE_FORMAT``,
1342
``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``YEAR_MONTH_FORMAT``.
1344
.. setting:: NUMBER_GROUPING
1349
.. versionadded:: 1.2
1353
Number of digits grouped together on the integer part of a number. Common use
1354
is to display a thousand separator. If this setting is ``0``, then, no grouping
1355
will be applied to the number. If this setting is greater than ``0`` then the
1356
setting :setting:`THOUSAND_SEPARATOR` will be used as the separator between those
1359
See also :setting:`THOUSAND_SEPARATOR` and :setting:`USE_THOUSAND_SEPARATOR`.
1361
.. setting:: PASSWORD_RESET_TIMEOUT_DAYS
1363
PASSWORD_RESET_TIMEOUT_DAYS
1364
---------------------------
1368
The number of days a password reset link is valid for. Used by the
1369
:mod:`django.contrib.auth` password reset mechanism.
1371
.. setting:: PREPEND_WWW
1378
Whether to prepend the "www." subdomain to URLs that don't have it. This is only
1379
used if :class:`~django.middleware.common.CommonMiddleware` is installed
1380
(see :doc:`/topics/http/middleware`). See also :setting:`APPEND_SLASH`.
1382
.. setting:: PROFANITIES_LIST
1387
Default: ``()`` (Empty tuple)
1389
A tuple of profanities, as strings, that will trigger a validation error when
1390
the ``hasNoProfanities`` validator is called.
1392
.. setting:: RESTRUCTUREDTEXT_FILTER_SETTINGS
1394
RESTRUCTUREDTEXT_FILTER_SETTINGS
1395
--------------------------------
1399
A dictionary containing settings for the ``restructuredtext`` markup filter from
1400
the :doc:`django.contrib.markup application </ref/contrib/markup>`. They override
1401
the default writer settings. See the Docutils restructuredtext `writer settings
1404
.. _writer settings docs: http://docutils.sourceforge.net/docs/user/config.html#html4css1-writer
1406
.. setting:: ROOT_URLCONF
1411
Default: Not defined
1413
A string representing the full Python import path to your root URLconf. For example:
1414
``"mydjangoapps.urls"``. Can be overridden on a per-request basis by
1415
setting the attribute ``urlconf`` on the incoming ``HttpRequest``
1416
object. See :ref:`how-django-processes-a-request` for details.
1418
.. setting:: SECRET_KEY
1423
Default: ``''`` (Empty string)
1425
A secret key for this particular Django installation. Used to provide a seed in
1426
secret-key hashing algorithms. Set this to a random string -- the longer, the
1427
better. ``django-admin.py startproject`` creates one automatically.
1429
.. setting:: SEND_BROKEN_LINK_EMAILS
1431
SEND_BROKEN_LINK_EMAILS
1432
-----------------------
1436
Whether to send an e-mail to the ``MANAGERS`` each time somebody visits a
1437
Django-powered page that is 404ed with a non-empty referer (i.e., a broken
1438
link). This is only used if ``CommonMiddleware`` is installed (see
1439
:doc:`/topics/http/middleware`. See also ``IGNORABLE_404_STARTS``,
1440
``IGNORABLE_404_ENDS`` and :doc:`/howto/error-reporting`.
1442
.. setting:: SERIALIZATION_MODULES
1444
SERIALIZATION_MODULES
1445
---------------------
1447
Default: Not defined.
1449
A dictionary of modules containing serializer definitions (provided as
1450
strings), keyed by a string identifier for that serialization type. For
1451
example, to define a YAML serializer, use::
1453
SERIALIZATION_MODULES = { 'yaml' : 'path.to.yaml_serializer' }
1455
.. setting:: SERVER_EMAIL
1460
Default: ``'root@localhost'``
1462
The e-mail address that error messages come from, such as those sent to
1463
``ADMINS`` and ``MANAGERS``.
1465
.. setting:: SESSION_COOKIE_AGE
1470
Default: ``1209600`` (2 weeks, in seconds)
1472
The age of session cookies, in seconds. See :doc:`/topics/http/sessions`.
1474
.. setting:: SESSION_COOKIE_DOMAIN
1476
SESSION_COOKIE_DOMAIN
1477
---------------------
1481
The domain to use for session cookies. Set this to a string such as
1482
``".lawrence.com"`` for cross-domain cookies, or use ``None`` for a standard
1483
domain cookie. See the :doc:`/topics/http/sessions`.
1485
.. setting:: SESSION_COOKIE_HTTPONLY
1487
SESSION_COOKIE_HTTPONLY
1488
-----------------------
1492
Whether to use HTTPOnly flag on the session cookie. If this is set to
1493
``True``, client-side JavaScript will not to be able to access the
1496
HTTPOnly_ is a flag included in a Set-Cookie HTTP response header. It
1497
is not part of the RFC2109 standard for cookies, and it isn't honored
1498
consistently by all browsers. However, when it is honored, it can be a
1499
useful way to mitigate the risk of client side script accessing the
1500
protected cookie data.
1502
.. _HTTPOnly: http://www.owasp.org/index.php/HTTPOnly
1504
.. setting:: SESSION_COOKIE_NAME
1509
Default: ``'sessionid'``
1511
The name of the cookie to use for sessions. This can be whatever you want (but
1512
should be different from ``LANGUAGE_COOKIE_NAME``). See the :doc:`/topics/http/sessions`.
1514
.. setting:: SESSION_COOKIE_PATH
1521
The path set on the session cookie. This should either match the URL path of your
1522
Django installation or be parent of that path.
1524
This is useful if you have multiple Django instances running under the same
1525
hostname. They can use different cookie paths, and each instance will only see
1526
its own session cookie.
1528
.. setting:: SESSION_COOKIE_SECURE
1530
SESSION_COOKIE_SECURE
1531
---------------------
1535
Whether to use a secure cookie for the session cookie. If this is set to
1536
``True``, the cookie will be marked as "secure," which means browsers may
1537
ensure that the cookie is only sent under an HTTPS connection.
1538
See the :doc:`/topics/http/sessions`.
1540
.. setting:: SESSION_ENGINE
1545
Default: ``django.contrib.sessions.backends.db``
1547
Controls where Django stores session data. Valid values are:
1549
* ``'django.contrib.sessions.backends.db'``
1550
* ``'django.contrib.sessions.backends.file'``
1551
* ``'django.contrib.sessions.backends.cache'``
1552
* ``'django.contrib.sessions.backends.cached_db'``
1554
See :doc:`/topics/http/sessions`.
1556
.. setting:: SESSION_EXPIRE_AT_BROWSER_CLOSE
1558
SESSION_EXPIRE_AT_BROWSER_CLOSE
1559
-------------------------------
1563
Whether to expire the session when the user closes his or her browser.
1564
See the :doc:`/topics/http/sessions`.
1566
.. setting:: SESSION_FILE_PATH
1573
If you're using file-based session storage, this sets the directory in
1574
which Django will store session data. See :doc:`/topics/http/sessions`. When
1575
the default value (``None``) is used, Django will use the standard temporary
1576
directory for the system.
1578
.. setting:: SESSION_SAVE_EVERY_REQUEST
1580
SESSION_SAVE_EVERY_REQUEST
1581
--------------------------
1585
Whether to save the session data on every request. See
1586
:doc:`/topics/http/sessions`.
1588
.. setting:: SHORT_DATE_FORMAT
1593
.. versionadded:: 1.2
1595
Default: ``m/d/Y`` (e.g. ``12/31/2003``)
1597
An available formatting that can be used for displaying date fields on
1598
templates. Note that if :setting:`USE_L10N` is set to ``True``, then the
1599
corresponding locale-dictated format has higher precedence and will be applied.
1600
See :tfilter:`allowed date format strings <date>`.
1602
See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
1604
.. setting:: SHORT_DATETIME_FORMAT
1606
SHORT_DATETIME_FORMAT
1607
---------------------
1609
.. versionadded:: 1.2
1611
Default: ``m/d/Y P`` (e.g. ``12/31/2003 4 p.m.``)
1613
An available formatting that can be used for displaying datetime fields on
1614
templates. Note that if :setting:`USE_L10N` is set to ``True``, then the
1615
corresponding locale-dictated format has higher precedence and will be applied.
1616
See :tfilter:`allowed date format strings <date>`.
1618
See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.
1620
.. setting:: SITE_ID
1625
Default: Not defined
1627
The ID, as an integer, of the current site in the ``django_site`` database
1628
table. This is used so that application data can hook into specific site(s)
1629
and a single database can manage content for multiple sites.
1631
See :doc:`/ref/contrib/sites`.
1633
.. _site framework docs: ../sites/
1635
.. setting:: STATIC_ROOT
1640
Default: ``''`` (Empty string)
1642
The absolute path to the directory where :djadmin:`collectstatic` will collect
1643
static files for deployment.
1645
Example: ``"/home/example.com/static/"``
1647
If the :doc:`staticfiles</ref/contrib/staticfiles>` contrib app is enabled
1648
(default) the :djadmin:`collectstatic` management command will collect static
1649
files into this directory. See the howto on :doc:`managing static
1650
files</howto/static-files>` for more details about usage.
1652
.. warning:: This should be an (initially empty) destination directory for
1653
collecting your static files from their permanent locations into one
1654
directory for ease of deployment; it is **not** a place to store your
1655
static files permanently. You should do that in directories that will be
1656
found by :doc:`staticfiles</ref/contrib/staticfiles>`'s
1657
:setting:`finders<STATICFILES_FINDERS>`, which by default, are
1658
``'static/'`` app sub-directories and any directories you include in
1659
:setting:`STATICFILES_DIRS`).
1661
See :doc:`staticfiles reference</ref/contrib/staticfiles>` and
1662
:setting:`STATIC_URL`.
1664
.. setting:: STATIC_URL
1671
URL to use when referring to static files located in :setting:`STATIC_ROOT`.
1673
Example: ``"/site_media/static/"`` or ``"http://static.example.com/"``
1675
If not ``None``, this will be used as the base path for
1676
:ref:`media definitions<form-media-paths>` and the
1677
:doc:`staticfiles app</ref/contrib/staticfiles>`.
1679
It must end in a slash if set to a non-empty value.
1681
See :setting:`STATIC_ROOT`.
1683
.. setting:: TEMPLATE_CONTEXT_PROCESSORS
1685
TEMPLATE_CONTEXT_PROCESSORS
1686
---------------------------
1690
("django.contrib.auth.context_processors.auth",
1691
"django.core.context_processors.debug",
1692
"django.core.context_processors.i18n",
1693
"django.core.context_processors.media",
1694
"django.core.context_processors.static",
1695
"django.contrib.messages.context_processors.messages")
1697
A tuple of callables that are used to populate the context in ``RequestContext``.
1698
These callables take a request object as their argument and return a dictionary
1699
of items to be merged into the context.
1701
.. versionchanged:: 1.2
1702
``django.contrib.messages.context_processors.messages`` was added to the
1703
default. For more information, see the :doc:`messages documentation
1704
</ref/contrib/messages>`.
1706
.. versionchanged:: 1.2
1707
The auth context processor was moved in this release from its old location
1708
``django.core.context_processors.auth`` to
1709
``django.contrib.auth.context_processors.auth``.
1711
.. versionadded:: 1.3
1712
The ``django.core.context_processors.static`` context processor
1713
was added in this release.
1715
.. setting:: TEMPLATE_DEBUG
1722
A boolean that turns on/off template debug mode. If this is ``True``, the fancy
1723
error page will display a detailed report for any ``TemplateSyntaxError``. This
1724
report contains the relevant snippet of the template, with the appropriate line
1727
Note that Django only displays fancy error pages if ``DEBUG`` is ``True``, so
1728
you'll want to set that to take advantage of this setting.
1732
.. setting:: TEMPLATE_DIRS
1737
Default: ``()`` (Empty tuple)
1739
List of locations of the template source files, in search order. Note that
1740
these paths should use Unix-style forward slashes, even on Windows.
1742
See :doc:`/topics/templates`.
1744
.. setting:: TEMPLATE_LOADERS
1751
('django.template.loaders.filesystem.Loader',
1752
'django.template.loaders.app_directories.Loader')
1754
A tuple of template loader classes, specified as strings. Each ``Loader`` class
1755
knows how to import templates from a particular source. Optionally, a tuple can be
1756
used instead of a string. The first item in the tuple should be the ``Loader``'s
1757
module, subsequent items are passed to the ``Loader`` during initialization. See
1758
:doc:`/ref/templates/api`.
1760
.. versionchanged:: 1.2
1761
The class-based API for template loaders was introduced in Django 1.2
1762
although the ``TEMPLATE_LOADERS`` setting will accept strings that specify
1763
function-based loaders until compatibility with them is completely removed in
1766
.. setting:: TEMPLATE_STRING_IF_INVALID
1768
TEMPLATE_STRING_IF_INVALID
1769
--------------------------
1771
Default: ``''`` (Empty string)
1773
Output, as a string, that the template system should use for invalid (e.g.
1774
misspelled) variables. See :ref:`invalid-template-variables`..
1776
.. setting:: TEST_RUNNER
1781
Default: ``'django.test.simple.DjangoTestSuiteRunner'``
1783
.. versionchanged:: 1.2
1784
Prior to 1.2, test runners were a function, not a class.
1786
The name of the class to use for starting the test suite. See
1787
:doc:`/topics/testing`.
1789
.. _Testing Django Applications: ../testing/
1791
.. setting:: THOUSAND_SEPARATOR
1796
.. versionadded:: 1.2
1798
Default ``,`` (Comma)
1800
Default thousand separator used when formatting numbers. This setting is
1801
used only when ``NUMBER_GROUPING`` and ``USE_THOUSAND_SEPARATOR`` are set.
1803
See also :setting:`NUMBER_GROUPING`, :setting:`DECIMAL_SEPARATOR` and
1804
:setting:`USE_THOUSAND_SEPARATOR`.
1806
.. setting:: TIME_FORMAT
1811
Default: ``'P'`` (e.g. ``4 p.m.``)
1813
The default formatting to use for displaying time fields in any part of the
1814
system. Note that if :setting:`USE_L10N` is set to ``True``, then the
1815
locale-dictated format has higher precedence and will be applied instead. See
1816
:tfilter:`allowed date format strings <date>`.
1818
.. versionchanged:: 1.2
1819
This setting can now be overriden by setting ``USE_L10N`` to ``True``.
1821
See also ``DATE_FORMAT`` and ``DATETIME_FORMAT``.
1823
.. setting:: TIME_INPUT_FORMATS
1828
.. versionadded:: 1.2
1830
Default: ``('%H:%M:%S', '%H:%M')``
1832
A tuple of formats that will be accepted when inputting data on a time
1833
field. Formats will be tried in order, using the first valid.
1834
Note that these format strings are specified in Python's datetime_ module
1835
syntax, that is different from the one used by Django for formatting dates
1838
See also ``DATE_INPUT_FORMATS`` and ``DATETIME_INPUT_FORMATS``.
1840
.. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
1842
.. setting:: TIME_ZONE
1847
Default: ``'America/Chicago'``
1849
.. versionchanged:: 1.2
1850
``None`` was added as an allowed value.
1852
A string representing the time zone for this installation, or
1853
``None``. `See available choices`_. (Note that list of available
1854
choices lists more than one on the same line; you'll want to use just
1855
one of the choices for a given time zone. For instance, one line says
1856
``'Europe/London GB GB-Eire'``, but you should use the first bit of
1857
that -- ``'Europe/London'`` -- as your ``TIME_ZONE`` setting.)
1859
Note that this is the time zone to which Django will convert all
1860
dates/times -- not necessarily the timezone of the server. For
1861
example, one server may serve multiple Django-powered sites, each with
1862
a separate time-zone setting.
1864
Normally, Django sets the ``os.environ['TZ']`` variable to the time
1865
zone you specify in the ``TIME_ZONE`` setting. Thus, all your views
1866
and models will automatically operate in the correct time zone.
1867
However, Django won't set the ``TZ`` environment variable under the
1868
following conditions:
1870
* If you're using the manual configuration option as described in
1871
:ref:`manually configuring settings
1872
<settings-without-django-settings-module>`, or
1874
* If you specify ``TIME_ZONE = None``. This will cause Django to fall
1875
back to using the system timezone.
1877
If Django doesn't set the ``TZ`` environment variable, it's up to you
1878
to ensure your processes are running in the correct environment.
1881
Django cannot reliably use alternate time zones in a Windows
1882
environment. If you're running Django on Windows, this variable
1883
must be set to match the system timezone.
1886
.. _See available choices: http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
1888
.. setting:: USE_ETAGS
1895
A boolean that specifies whether to output the "Etag" header. This saves
1896
bandwidth but slows down performance. This is used by the ``CommonMiddleware``
1897
(see :doc:`/topics/http/middleware`) and in the``Cache Framework``
1898
(see :doc:`/topics/cache`).
1900
.. setting:: USE_I18N
1907
A boolean that specifies whether Django's internationalization system should be
1908
enabled. This provides an easy way to turn it off, for performance. If this is
1909
set to ``False``, Django will make some optimizations so as not to load the
1910
internationalization machinery.
1912
See also ``USE_L10N``
1914
.. setting:: USE_L10N
1919
.. versionadded:: 1.2
1923
A boolean that specifies if data will be localized by default or not. If this
1924
is set to ``True``, e.g. Django will display numbers and dates using the
1925
format of the current locale.
1927
See also ``USE_I18N`` and ``LANGUAGE_CODE``
1929
.. setting:: USE_THOUSAND_SEPARATOR
1931
USE_THOUSAND_SEPARATOR
1932
----------------------
1934
.. versionadded:: 1.2
1938
A boolean that specifies wheter to display numbers using a thousand separator.
1939
If this is set to ``True``, Django will use values from ``THOUSAND_SEPARATOR``
1940
and ``NUMBER_GROUPING`` from current locale, to format the number.
1941
``USE_L10N`` must be set to ``True``, in order to format numbers.
1943
See also ``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``.
1945
.. setting:: USE_X_FORWARDED_HOST
1947
USE_X_FORWARDED_HOST
1948
--------------------
1950
.. versionadded:: 1.3.1
1954
A boolean that specifies whether to use the X-Forwarded-Host header in
1955
preference to the Host header. This should only be enabled if a proxy
1956
which sets this header is in use.
1958
.. setting:: YEAR_MONTH_FORMAT
1965
The default formatting to use for date fields on Django admin change-list
1966
pages -- and, possibly, by other parts of the system -- in cases when only the
1967
year and month are displayed.
1969
For example, when a Django admin change-list page is being filtered by a date
1970
drilldown, the header for a given month displays the month and the year.
1971
Different locales have different formats. For example, U.S. English would say
1972
"January 2006," whereas another locale might say "2006/January."
1974
See :tfilter:`allowed date format strings <date>`. See also ``DATE_FORMAT``,
1975
``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``MONTH_DAY_FORMAT``.
1980
.. setting:: CACHE_BACKEND
1986
This setting has been replaced by :setting:`BACKEND <CACHES-BACKEND>` in
1989
.. setting:: DATABASE_ENGINE
1995
This setting has been replaced by :setting:`ENGINE` in
1996
:setting:`DATABASES`.
1998
.. setting:: DATABASE_HOST
2004
This setting has been replaced by :setting:`HOST` in
2005
:setting:`DATABASES`.
2007
.. setting:: DATABASE_NAME
2013
This setting has been replaced by :setting:`NAME` in
2014
:setting:`DATABASES`.
2016
.. setting:: DATABASE_OPTIONS
2022
This setting has been replaced by :setting:`OPTIONS` in
2023
:setting:`DATABASES`.
2025
.. setting:: DATABASE_PASSWORD
2031
This setting has been replaced by :setting:`PASSWORD` in
2032
:setting:`DATABASES`.
2034
.. setting:: DATABASE_PORT
2040
This setting has been replaced by :setting:`PORT` in
2041
:setting:`DATABASES`.
2043
.. setting:: DATABASE_USER
2049
This setting has been replaced by :setting:`USER` in
2050
:setting:`DATABASES`.
2052
.. setting:: TEST_DATABASE_CHARSET
2054
TEST_DATABASE_CHARSET
2055
---------------------
2058
This setting has been replaced by :setting:`TEST_CHARSET` in
2059
:setting:`DATABASES`.
2061
.. setting:: TEST_DATABASE_COLLATION
2063
TEST_DATABASE_COLLATION
2064
-----------------------
2067
This setting has been replaced by :setting:`TEST_COLLATION` in
2068
:setting:`DATABASES`.
2070
.. setting:: TEST_DATABASE_NAME
2076
This setting has been replaced by :setting:`TEST_NAME` in
2077
:setting:`DATABASES`.
2081
URL_VALIDATOR_USER_AGENT
2082
------------------------
2084
.. deprecated:: 1.3.1
2085
This setting has been removed due to intractable performance and
2088
Default: ``Django/<version> (http://www.djangoproject.com/)``
2090
The string to use as the ``User-Agent`` header when checking to see if
2091
URLs exist (see the ``verify_exists`` option on
2092
:class:`~django.db.models.URLField`). This setting was deprecated in
2093
1.3.1 along with ``verify_exists`` and will be removed in 1.4.