Stopped populating the app registry as a side effect.

Since it triggers imports, it shouldn't be done lightly.

This commit adds a public API for doing it explicitly, django.setup(),
and does it automatically when using manage.py and wsgi.py.
This commit is contained in:
Aymeric Augustin 2013-12-30 15:42:15 +01:00
parent 7ed20e0153
commit 80d74097b4
13 changed files with 65 additions and 52 deletions

View file

@ -14,6 +14,12 @@ two things for you before delegating to ``django-admin.py``:
* It sets the :envvar:`DJANGO_SETTINGS_MODULE` environment variable so that
it points to your project's ``settings.py`` file.
* It calls ``django.setup()`` to initialize various internals of Django.
.. versionadded:: 1.7
``django.setup()`` didn't exist in previous versions of Django.
The ``django-admin.py`` script should be on your system path if you installed
Django via its ``setup.py`` utility. If it's not on your path, you can find it
in ``site-packages/django/bin`` within your Python installation. Consider