To create a new app in Django we utilize the
startapp command. This creates a Django app directory with a specified app name.
The app is created in by going in the root folder of your Django project and run the following command. The root folder is where the manage.py file is by the way.
$ python manage.py startapp plebapp
This results in a new directory being created named
plebapp with the file structure as shown below.
$ tree plebapp plebapp ├── admin.py ├── apps.py ├── __init__.py ├── migrations │ └── __init__.py ├── models.py ├── tests.py └── views.py
In order to use this app we are almost set. To actually include the app in our projects it has to be added to
INSTALLED_APPS in the settings. You can reference the new app by its name.
INSTALLED_APPS = [ ... 'plebapp', ]
Or by referencing the Config class you find in
INSTALLED_APPS = [ ... 'plebapp.apps.PlebappConfig', ]