Skip to main content

Create the new app

Let's start by creating a new app with the django command-line tool:

  1. Create a new empty app with the django command:

    cd apps
    pipenv run django-admin startapp <app_name>

    For this example, let's assume we created an app called event.

  2. Now open the apps.py file in your <app_name> folder, and add apps. to the name attribue:

    backend/apps/event/apps.py
    from django.apps import AppConfig

    class EventConfig(AppConfig):
    name = 'apps.event' # add 'apps.' to the name attribute
  3. Then, add your app to the INSTALLED_APPS list in the django settings:

    backend/config/settings/base.py
    DJANGO_APPS = # ...
    THIRD_PARTY_APPS = # ...
    COMMON_APPS = [
    # ...
    "apps.event",
    ]
    INSTALLED_APPS = DJANGO_APPS + COMMON_APPS + THIRD_PARTY_APPS
  4. Finally, we need to update your database:

    pipenv run migrate