Projects and Apps
Django uses two words that sound alike and mean different things. The project is the whole cookbook website. An app is one feature inside it, such as recipes. Keep them straight and every folder in a Django codebase makes sense.
The rule
One project per site; one app per feature.
With the environment active, create the project. The final dot means "put it in the current folder":
django-admin startproject cookbook .cookbook/ <- the folder you made earlier
├── manage.py <- the command tool for this project
└── cookbook/ <- the project's Python package
├── __init__.py
├── settings.py <- configuration for the whole site
├── urls.py <- the site's root table of URLs
├── asgi.py <- entry point for async servers
└── wsgi.py <- entry point for classic serversNow create an app for the first feature:
python manage.py startapp recipesrecipes/
├── __init__.py
├── admin.py <- show models in the admin site
├── apps.py <- the app's configuration class
├── migrations/ <- database change history
├── models.py <- data
├── tests.py <- tests
└── views.py <- request handlersAn app does nothing until you switch it on in settings.py:
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
# ...the other built-in apps...
"recipes",
]Notice that the built-in admin and login system are apps too. Django itself is assembled the same way you will build the cookbook.