Join my Asyncio (Python) course on Udemy for free 👀

Register apps by package name vs dotted path in Django

March 23, 2021  ‐ 1 min read

When you create a new app in Django with python startapp <app name> you need to register it by adding it to the INSTALLED_APPS in the file. I often forget the last step :).

You can add an app in two ways to INSTALLED_APPS, either by adding the package name or the dotted path to a subclass of AppConfig. According to the Django docs the latter is preferred.

The following shows both ways of registering a Django app.


    # ...


So what is the difference between the two? The latter option, with dotted path, allows you to add configuration options to your app. For example, you can override the ready method where you can registering signals. The first, just the package name, will use the configuration from the class django.apps.AppConfig. You might not need to change the app config right away but using the dotted path allows you to be more flexible in the future.