Creating your first Django app
A Django project is the whole site's configuration; an app is one self-contained piece of functionality inside it — this project's blog, and later maybe a separate app for user profiles or comments moderation. Splitting things this way is what lets an app be reused across projects, or removed cleanly if a feature gets cut.
Generating the app
python manage.py startapp blogblog/
__init__.py
admin.py
apps.py
migrations/
__init__.py
models.py
tests.py
views.pymodels.py will hold the Post and Comment data structures (part 5), views.py the request-handling logic (part 3), admin.py the admin panel configuration (part 7), and migrations/ the generated database schema history (part 6). Notice there's no urls.py or templates/ folder yet — Django doesn't generate those by default; both get added by hand as this series goes.
Registering the app
# blogsite/settings.py
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"blog",
]Creating an app's folder doesn't make Django aware of it — INSTALLED_APPS is the actual registry. Skip this step and the app's models never get picked up by migrations, its templates directory never gets searched, and its admin registrations silently do nothing.
Forgetting to add the new app to INSTALLED_APPS, then spending twenty minutes debugging why makemigrations in part 6 says "No changes detected" for a model that clearly exists. It's almost always this.
What "app" means in practice
The built-in apps already in INSTALLED_APPS — admin, auth, sessions — are proof this isn't a special pattern reserved for your own code: Django's own admin panel and user authentication are just apps, built the same way blog is about to be. That's also why authentication in part 16 needs almost no code of its own — django.contrib.auth already did the work.
FAQ
Can one project have multiple apps?
Yes — that's the normal case. This series stays focused on a single blog app, but a real Django project often has several (blog, accounts, comments), each generated with its own startapp call and its own entry in INSTALLED_APPS.
Can I rename an app after creating it?
Technically yes, but it touches more than the folder name — the app's apps.py, every import referencing it, INSTALLED_APPS, and any migration history that references the app's label. Choosing a name you're reasonably confident in upfront avoids this rather than fixing it after models and migrations already exist.
Why doesn't startapp generate urls.py or a templates/ folder?
Because not every app needs them — a small utility app might have models and admin registration only, with no URLs or templates of its own. Django generates only what every app needs (models, views, admin, migrations) and leaves the rest to be added when actually needed, which happens starting next part.
Next: connecting a URL to your first view, so visiting a page actually runs blog's code.