Most documentation simply tells you to add the name of each of your apps to the INSTALLED_APPS array in your Django project's settings. What is the benefit/purpose of this? What different functionality will I get if I create 2 apps, but only include the name of one in my INSTALLED_APPS array?
The order of INSTALLED_APPS is significant! Django applies the following algorithm for discovering translations: The directories listed in LOCALE_PATHS have the highest precedence, with the ones appearing first having higher precedence than the ones appearing later.
While you're editing mysite/settings.py , set TIME_ZONE to your time zone. Also, note the INSTALLED_APPS setting at the top of the file. That holds the names of all Django applications that are activated in this Django instance.
settings.py is a core file in Django projects. It holds all the configuration values that your web app needs to work; database settings, logging configuration, where to find static files, API keys if you work with external APIs, and a bunch of other stuff.
Django uses INSTALLED_APPS
as a list of all of the places to look for models, management commands, tests, and other utilities.
If you made two apps (say myapp
and myuninstalledapp
), but only one was listed in INSTALLED_APPS
, you'd notice the following behavior:
myuninstalledapp/models.py
would never trigger migration changes (or generate initial migrations). You wouldn't be able to interact with them on the database level either because their tables will have never been created.myapp/static/
would be discovered as part of collectstatic or the test server's staticfiles serving, but myuninstalledapp/static
files wouldn't be.myapp/tests.py
would run but myuninstalledapp/tests.py
wouldn't.myuninstalledapp/management/commands/
wouldn't be discovered.So really, you're welcome to have folders within your Django project that aren't installed apps (you can even create them with python manage.py startapp
) but just know that certain auto-discovery Django utilities won't work for that application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With