Skip to content

Commit

Permalink
Documented unicity rules in INSTALLED_APPS.
Browse files Browse the repository at this point in the history
Refs #12288, #21679.
  • Loading branch information
aaugustin committed Jan 1, 2014
1 parent 2139e09 commit 8a2f304
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions docs/ref/settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1286,25 +1286,38 @@ INSTALLED_APPS
Default: ``()`` (Empty tuple)

A tuple of strings designating all applications that are enabled in this
Django installation. Each string should be a full Python path to an
application configuration class or to a Python package containing a
application. :doc:`Learn more about applications </ref/applications>`.
Django installation. Each string should be a dotted Python path to:

* an application configuration class, or
* a package containing a application.

:doc:`Learn more about application configurations </ref/applications>`.

.. versionchanged:: 1.7

:setting:`INSTALLED_APPS` now supports application configurations.

.. admonition:: Use the application registry for introspection

Your code should never access :setting:`INSTALLED_APPS` directly. Use the
app registry, :attr:`django.apps.apps`, instead.
Your code should never access :setting:`INSTALLED_APPS` directly. Use
:attr:`django.apps.apps` instead.

.. admonition:: Application names and labels must be unique in
:setting:`INSTALLED_APPS`

Application :attr:`names <django.apps.AppConfig.name>` — the dotted Python
path to the application package — must be unique. There is no way to
include the same application twice, short of duplicating its code under
another name.

.. admonition:: Application labels must be unique
Application :attr:`labels <django.apps.AppConfig.label>` — by default the
final part of the name — must be unique too. For example, you can't
include both ``django.contrib.auth`` and ``myproject.auth``. However, you
can relabel an application with a custom configuration that defines a
different :attr:`~django.apps.AppConfig.label`.

Application labels (that is, the final part of the dotted path to
application packages) *must* be unique in :setting:`INSTALLED_APPS`.
For example, you can't include both ``django.contrib.auth`` and
``myproject.auth``.
These rules apply regardless of whether :setting:`INSTALLED_APPS`
references application configuration classes on application packages.

.. setting:: INTERNAL_IPS

Expand Down

0 comments on commit 8a2f304

Please sign in to comment.