Projects, Apps, and manage.py

Project versus app. A project is the whole site: its settings, its root URL configuration, the thing you deploy. An app is one self-contained piece of functionality inside it.

One project, many apps. An app should do one thing, and ideally be something you could lift into another project.

SANKOFA SANDBOX
The two commands that create the structure. Try them here; the filesystem is a sandbox.
learner:/workspace$

This shell is a simulation of a real one, not Django itself. It is here so the folder layout is something you have typed rather than only read.

Try it → Make a directory called journal, move into it, and create files named manage.py and settings.py. That is roughly the shape startproject produces.

What the commands do.

django-admin startproject sankofa_journal . creates the project. The trailing dot matters: without it you get a folder inside a folder of the same name, which confuses everyone once.

python manage.py startapp posts creates an app.

Then the step people forget: add the app to INSTALLED_APPS. Until you do, Django ignores it completely. Not with an error, just silently. Its models will not migrate and its templates will not be found.

manage.py is the command for nearly everything.

runserver starts the development server.

makemigrations writes a plan for changing the database.

migrate applies it.

createsuperuser makes an account for the admin.

shell opens Python with Django loaded, which is the fastest way to try a query.

test runs your tests.

Mark this lesson complete

Signed in, your progress follows you to every device.

Next: Practice Test →
← Back