How to create a new Django app within a project?

Published on Aug. 22, 2023, 12:19 p.m.

To create a new Django app within a project, you can use the following command in the terminal, where “myapp” is the name of the new app you want to create:

python manage.py startapp myapp

This will create a directory called “myapp” within your Django project directory, with the necessary files and directories for a new Django app. You can then start adding functionality to the new app by editing the files within the directory. Don’t forget to add the new app to the INSTALLED_APPS list in your project’s settings.py file, so that Django knows to include it in the project.

INSTALLED_APPS = [
    #...
    'myapp',
]

Tags: