← Back to Django Course | Chapter 2: Apps, URLs & Views | Lesson 3 of 10

Registering Apps in INSTALLED_APPS

INSTALLED_APPS is like a guest list — Django only lets a toy box (app) join the party if its name is written on that list.

The INSTALLED_APPS Setting

settings.py contains a Python list called INSTALLED_APPS. It starts with Django's built-in apps (admin, auth, sessions) and is where you add every app you create or install.

Example: The INSTALLED_APPS Setting

settings.py contains a Python list called INSTALLED_APPS. It starts with Django's built-in apps (admin, auth, sessions) and is where you add every app you create or install.

markup
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.sessions',
    'blog',
]
{# Django-only code -- models.py/views.py/urls.py/settings.py snippets, or template markup using Django template tags/variables -- can't run standalone via Judge0 or the browser preview, since it needs a real Django project. Only this course's pure-Python examples (example_lang == 'python', no Django imports) are actually runnable, so those still get the button below. #}

Short Name vs AppConfig Path

You can register an app by its short package name (blog) or by pointing directly at its AppConfig class ('blog.apps.BlogConfig'). Both work identically; the explicit path is useful when an app defines custom AppConfig behavior.

Note: Prefer the AppConfig path when the app overrides default_auto_field or adds a ready() hook.

Example: Short Name vs AppConfig Path

You can register an app by its short package name (blog) or by pointing directly at its AppConfig class ('blog.apps.BlogConfig'). Both work identically; the explicit path is useful when an app defines custom AppConfig behavior.

markup
INSTALLED_APPS = [
    # ...
    'blog.apps.BlogConfig',
]
{# Django-only code -- models.py/views.py/urls.py/settings.py snippets, or template markup using Django template tags/variables -- can't run standalone via Judge0 or the browser preview, since it needs a real Django project. Only this course's pure-Python examples (example_lang == 'python', no Django imports) are actually runnable, so those still get the button below. #}

Why Registration Matters

Only apps listed in INSTALLED_APPS get their models discovered by makemigrations, their admin.py loaded, and their templates/static folders searched by Django's template and staticfiles finders.

Example: Why Registration Matters

Only apps listed in INSTALLED_APPS get their models discovered by makemigrations, their admin.py loaded, and their templates/static folders searched by Django's template and staticfiles finders.

bash
python manage.py makemigrations
# 'No changes detected' if the app isn't in INSTALLED_APPS yet

⚠️ Run this command in your terminal.

Common Mistakes
  1. Creating an app with startapp but never adding it to INSTALLED_APPS, so its models never get migrated.
  2. Adding the wrong dotted path (e.g. 'blog.apps' instead of 'blog.apps.BlogConfig' or just blog).
  3. Placing a custom app before Django's built-in apps in a way that breaks template or static file overriding order.
Chapter Summary
  • INSTALLED_APPS in settings.py is the list of every app Django will load.
  • Both the short form (blog) and the AppConfig dotted path ('blog.apps.BlogConfig') work as entries.
  • An app's models, admin, and template tags are invisible to Django until it appears in this list.

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.