Permalink
Browse files

[1.3.X] Fixed #15992 -- Added more references to settings. Thanks, aa…

…ugustin.

Backport from trunk (r16290).

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 7f3eda2 commit 879267f254946a26ebc179f3880e14a59e11e038 @jezdez jezdez committed May 29, 2011
View
@@ -8,16 +8,16 @@ The login cookie isn't being set correctly, because the domain of the cookie
sent out by Django doesn't match the domain in your browser. Try these two
things:
- * Set the ``SESSION_COOKIE_DOMAIN`` setting in your admin config file
- to match your domain. For example, if you're going to
+ * Set the :setting:`SESSION_COOKIE_DOMAIN` setting in your admin config
+ file to match your domain. For example, if you're going to
"http://www.example.com/admin/" in your browser, in
"myproject.settings" you should set ``SESSION_COOKIE_DOMAIN = 'www.example.com'``.
* Some browsers (Firefox?) don't like to accept cookies from domains that
don't have dots in them. If you're running the admin site on "localhost"
or another domain that doesn't have a dot in it, try going to
"localhost.localdomain" or "127.0.0.1". And set
- ``SESSION_COOKIE_DOMAIN`` accordingly.
+ :setting:`SESSION_COOKIE_DOMAIN` accordingly.
I can't log in. When I enter a valid username and password, it brings up the login page again, with a "Please enter a correct username and password" error.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
View
@@ -6,16 +6,17 @@ FAQ: Databases and models
How can I see the raw SQL queries Django is running?
----------------------------------------------------
-Make sure your Django ``DEBUG`` setting is set to ``True``. Then, just do
-this::
+Make sure your Django :setting:`DEBUG` setting is set to ``True``.
+Then, just do this::
>>> from django.db import connection
>>> connection.queries
[{'sql': 'SELECT polls_polls.id,polls_polls.question,polls_polls.pub_date FROM polls_polls',
'time': '0.002'}]
-``connection.queries`` is only available if ``DEBUG`` is ``True``. It's a list
-of dictionaries in order of query execution. Each dictionary has the following::
+``connection.queries`` is only available if :setting:`DEBUG` is ``True``.
+It's a list of dictionaries in order of query execution. Each dictionary has
+the following::
``sql`` -- The raw SQL statement
``time`` -- How long the statement took to execute, in seconds.
@@ -90,13 +91,13 @@ Why is Django leaking memory?
Django isn't known to leak memory. If you find your Django processes are
allocating more and more memory, with no sign of releasing it, check to make
-sure your ``DEBUG`` setting is set to ``False``. If ``DEBUG`` is ``True``, then
-Django saves a copy of every SQL statement it has executed.
+sure your :setting:`DEBUG` setting is set to ``False``. If :setting:`DEBUG`
+is ``True``, then Django saves a copy of every SQL statement it has executed.
(The queries are saved in ``django.db.connection.queries``. See
`How can I see the raw SQL queries Django is running?`_.)
-To fix the problem, set ``DEBUG`` to ``False``.
+To fix the problem, set :setting:`DEBUG` to ``False``.
If you need to clear the query list manually at any point in your functions,
just call ``reset_queries()``, like this::
View
@@ -55,7 +55,7 @@ message file specific to the project you are composing. The choice is yours.
All message file repositories are structured the same way. They are:
- * All paths listed in ``LOCALE_PATHS`` in your settings file are
+ * All paths listed in :setting:`LOCALE_PATHS` in your settings file are
searched for ``<language>/LC_MESSAGES/django.(po|mo)``
* ``$PROJECTPATH/locale/<language>/LC_MESSAGES/django.(po|mo)`` --
deprecated, see above.
@@ -167,9 +167,9 @@ their deprecation, as per the :ref:`Django deprecation policy
and :class:`django.contrib.auth.context_processors.PermLookupDict`,
respectively.
- * The ``MEDIA_URL`` or ``STATIC_URL`` settings are required to end
- with a trailing slash to ensure there is a consistent way to
- combine paths in templates.
+ * The :setting:`MEDIA_URL` or :setting:`STATIC_URL` settings are
+ required to end with a trailing slash to ensure there is a consistent
+ way to combine paths in templates.
* 2.0
* ``django.views.defaults.shortcut()``. This function has been moved
@@ -1624,7 +1624,7 @@ In this example, we register the default ``AdminSite`` instance
)
Above we used ``admin.autodiscover()`` to automatically load the
-``INSTALLED_APPS`` admin.py modules.
+:setting:`INSTALLED_APPS` admin.py modules.
In this example, we register the ``AdminSite`` instance
``myproject.admin.admin_site`` at the URL ``/myadmin/`` ::
@@ -18,7 +18,7 @@ the GeoIP C libary and either the GeoIP `Country`__ or `City`__
datasets in binary format (the CSV files will not work!). These datasets may be
`downloaded from MaxMind`__. Grab the ``GeoIP.dat.gz`` and ``GeoLiteCity.dat.gz``
and unzip them in a directory corresponding to what you set
-``GEOIP_PATH`` with in your settings. See the example and reference below
+:setting:`GEOIP_PATH` with in your settings. See the example and reference below
for more details.
__ http://www.maxmind.com/app/c
@@ -184,9 +184,9 @@ If using a binary package of GEOS (e.g., on Ubuntu), you may need to :ref:`binut
~~~~~~~~~~~~~~~~~~~~~
If your GEOS library is in a non-standard location, or you don't want to
-modify the system's library path then the :setting:`GEOS_LIBRARY_PATH` setting
-may be added to your Django settings file with the full path to the GEOS
-C library. For example::
+modify the system's library path then the :setting:`GEOS_LIBRARY_PATH`
+setting may be added to your Django settings file with the full path to the
+GEOS C library. For example::
GEOS_LIBRARY_PATH = '/home/bob/local/lib/libgeos_c.so'
@@ -592,8 +592,8 @@ Now, the ``spatialite`` command can be used to initialize a spatial database::
__ http://www.gaia-gis.it/spatialite/resources.html
-Add ``django.contrib.gis`` to ``INSTALLED_APPS``
-------------------------------------------------
+Add ``django.contrib.gis`` to :setting:`INSTALLED_APPS`
+-------------------------------------------------------
Like other Django contrib applications, you will *only* need to add
:mod:`django.contrib.gis` to :setting:`INSTALLED_APPS` in your settings.
@@ -14,8 +14,8 @@ those packages have.
For most of these add-ons -- specifically, the add-ons that include either
models or template tags -- you'll need to add the package name (e.g.,
- ``'django.contrib.admin'``) to your ``INSTALLED_APPS`` setting and re-run
- ``manage.py syncdb``.
+ ``'django.contrib.admin'``) to your :setting:`INSTALLED_APPS` setting and
+ re-run ``manage.py syncdb``.
.. _"batteries included" philosophy: http://docs.python.org/tutorial/stdlib.html#batteries-included
@@ -414,7 +414,7 @@ SESSION_COOKIE_DOMAIN
Default: ``None``
The storage backends that use cookies -- ``CookieStorage`` and
-``FallbackStorage`` -- use the value of ``SESSION_COOKIE_DOMAIN`` in
+``FallbackStorage`` -- use the value of :setting:`SESSION_COOKIE_DOMAIN` in
setting their cookies. See the :doc:`settings documentation </ref/settings>`
for more information on how this works and why you might need to set it.
@@ -262,8 +262,8 @@ Connection settings are used in this order:
:setting:`HOST`, :setting:`PORT`
3. MySQL option files.
-In other words, if you set the name of the database in ``OPTIONS``,
-this will take precedence over ``NAME``, which would override
+In other words, if you set the name of the database in :setting:`OPTIONS`,
+this will take precedence over :setting:`NAME`, which would override
anything in a `MySQL option file`_.
Here's a sample configuration which uses a MySQL option file::
@@ -551,7 +551,7 @@ Your Django settings.py file should look something like this for Oracle::
If you don't use a ``tnsnames.ora`` file or a similar naming method that
recognizes the SID ("xe" in this example), then fill in both
-``HOST`` and ``PORT`` like so::
+:setting:`HOST` and :setting:`PORT` like so::
DATABASES = {
'default': {
@@ -564,7 +564,7 @@ recognizes the SID ("xe" in this example), then fill in both
}
}
-You should supply both ``HOST`` and ``PORT``, or leave both
+You should supply both :setting:`HOST` and :setting:`PORT`, or leave both
as empty strings.
Threaded option
@@ -57,7 +57,7 @@ App names
---------
Many commands take a list of "app names." An "app name" is the basename of
-the package containing your models. For example, if your ``INSTALLED_APPS``
+the package containing your models. For example, if your :setting:`INSTALLED_APPS`
contains the string ``'mysite.blog'``, the app name is ``blog``.
Determining the version
@@ -126,7 +126,7 @@ dbshell
Runs the command-line client for the database engine specified in your
``ENGINE`` setting, with the connection parameters specified in your
-``USER``, ``PASSWORD``, etc., settings.
+:setting:`USER`, :setting:`PASSWORD`, etc., settings.
* For PostgreSQL, this runs the ``psql`` command-line client.
* For MySQL, this runs the ``mysql`` command-line client.
@@ -151,8 +151,9 @@ Displays differences between the current settings file and Django's default
settings.
Settings that don't appear in the defaults are followed by ``"###"``. For
-example, the default settings don't define ``ROOT_URLCONF``, so
-``ROOT_URLCONF`` is followed by ``"###"`` in the output of ``diffsettings``.
+example, the default settings don't define :setting:`ROOT_URLCONF`, so
+:setting:`ROOT_URLCONF` is followed by ``"###"`` in the output of
+``diffsettings``.
Note that Django's default settings live in ``django/conf/global_settings.py``,
if you're ever curious to see the full list of defaults.
@@ -245,7 +246,7 @@ inspectdb
.. django-admin:: inspectdb
Introspects the database tables in the database pointed-to by the
-``NAME`` setting and outputs a Django model module (a ``models.py``
+:setting:`NAME` setting and outputs a Django model module (a ``models.py``
file) to standard output.
Use this if you have a legacy database with which you'd like to use Django.
@@ -309,7 +310,7 @@ fixture can be distributed over multiple directories, in multiple applications.
Django will search in three locations for fixtures:
1. In the ``fixtures`` directory of every installed application
- 2. In any directory named in the ``FIXTURE_DIRS`` setting
+ 2. In any directory named in the :setting:`FIXTURE_DIRS` setting
3. In the literal path named by the fixture
Django will load any and all fixtures it finds in these locations that match
@@ -340,7 +341,7 @@ directories will be included in the search path. For example::
would search ``<appname>/fixtures/foo/bar/mydata.json`` for each installed
application, ``<dirname>/foo/bar/mydata.json`` for each directory in
-``FIXTURE_DIRS``, and the literal path ``foo/bar/mydata.json``.
+:setting:`FIXTURE_DIRS`, and the literal path ``foo/bar/mydata.json``.
When fixture files are processed, the data is saved to the database as is.
Model defined ``save`` methods and ``pre_save`` signals are not called.
@@ -742,7 +743,7 @@ Serving static files with the development server
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By default, the development server doesn't serve any static files for your site
-(such as CSS files, images, things under ``MEDIA_URL`` and so forth). If
+(such as CSS files, images, things under :setting:`MEDIA_URL` and so forth). If
you want to configure Django to serve static media, read :doc:`/howto/static-files`.
shell
@@ -912,13 +913,13 @@ syncdb
.. django-admin:: syncdb
-Creates the database tables for all apps in ``INSTALLED_APPS`` whose tables
-have not already been created.
+Creates the database tables for all apps in :setting:`INSTALLED_APPS` whose
+tables have not already been created.
Use this command when you've added new applications to your project and want to
install them in the database. This includes any apps shipped with Django that
-might be in ``INSTALLED_APPS`` by default. When you start a new project, run
-this command to install the default apps.
+might be in :setting:`INSTALLED_APPS` by default. When you start a new project,
+run this command to install the default apps.
.. admonition:: Syncdb will not alter existing tables
@@ -1032,8 +1033,8 @@ validate
.. django-admin:: validate
-Validates all installed models (according to the ``INSTALLED_APPS`` setting)
-and prints validation errors to standard output.
+Validates all installed models (according to the :setting:`INSTALLED_APPS`
+setting) and prints validation errors to standard output.
Commands provided by applications
=================================
@@ -759,7 +759,7 @@ Takes the following optional arguments:
.. attribute:: URLField.validator_user_agent
String used as the user-agent used when checking for a URL's existence.
- Defaults to the value of the ``URL_VALIDATOR_USER_AGENT`` setting.
+ Defaults to the value of the :setting:`URL_VALIDATOR_USER_AGENT` setting.
.. versionchanged:: 1.2
The URLField previously did not recognize URLs as valid that contained an IDN
@@ -58,7 +58,7 @@ which is a dictionary of the parameters captured in the URL.
just before rendering the template.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
**Example:**
@@ -198,7 +198,7 @@ a date in the *future* are not included unless you set ``allow_future`` to
the view's template.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
* ``allow_future``: A boolean specifying whether to include "future"
objects on this page, where "future" means objects in which the field
@@ -290,7 +290,7 @@ to ``True``.
this is ``False``.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
* ``allow_future``: A boolean specifying whether to include "future"
objects on this page, where "future" means objects in which the field
@@ -377,7 +377,7 @@ date in the *future* are not displayed unless you set ``allow_future`` to
determining the variable's name.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
* ``allow_future``: A boolean specifying whether to include "future"
objects on this page, where "future" means objects in which the field
@@ -465,7 +465,7 @@ in the *future* are not displayed unless you set ``allow_future`` to ``True``.
determining the variable's name.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
* ``allow_future``: A boolean specifying whether to include "future"
objects on this page, where "future" means objects in which the field
@@ -550,7 +550,7 @@ you set ``allow_future`` to ``True``.
determining the variable's name.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
* ``allow_future``: A boolean specifying whether to include "future"
objects on this page, where "future" means objects in which the field
@@ -660,7 +660,7 @@ future, the view will throw a 404 error by default, unless you set
to use in the template context. By default, this is ``'object'``.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
* ``allow_future``: A boolean specifying whether to include "future"
objects on this page, where "future" means objects in which the field
@@ -738,7 +738,7 @@ A page representing a list of objects.
determining the variable's name.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
**Template name:**
@@ -852,7 +852,7 @@ A page representing an individual object.
to use in the template context. By default, this is ``'object'``.
* ``mimetype``: The MIME type to use for the resulting document. Defaults
- to the value of the ``DEFAULT_CONTENT_TYPE`` setting.
+ to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting.
**Template name:**
Oops, something went wrong.

0 comments on commit 879267f

Please sign in to comment.