Django Apps Explained
In Django, a 'project' is the whole website configuration, while an 'app' is a self-contained Python package that implements one specific piece of functionality, such as a blog, a polls system, or a payments module. python manage.py startapp blog generates a directory with models.py, views.py, admin.py, apps.py, and a migrations/ folder, and the same app can, in principle, be dropped into a different Django project and reused, because it doesn't hardcode project-wide configuration itself.
Cricket analogy: Similar to how a bowling all-rounder like Ravindra Jadeja can be dropped into different XI lineups across formats and still perform his specific role, a well-built Django app like blog can be dropped into a different project and still perform its specific function.
Registering an App
Creating an app with startapp is not enough for Django to use it — the app must also be added to the INSTALLED_APPS list in settings.py, usually by referencing its AppConfig class from apps.py, such as 'blog.apps.BlogConfig'. Only once an app is registered does Django's migration system detect its models, does the template loader look inside its templates/ folder, and does the admin site discover any models registered via admin.py — an easy mistake for beginners is writing a model but forgetting this registration step, resulting in makemigrations silently finding no changes.
Cricket analogy: Similar to how a player must be officially registered with the BCCI before they're eligible to be picked for a Ranji Trophy squad, a Django app must be added to INSTALLED_APPS before Django will detect its models during makemigrations.
Project vs App: A Practical Split
A useful rule of thumb is that a project can contain many apps, and each app should be focused enough that its name describes one clear responsibility — accounts for user profiles, blog for posts and comments, payments for billing — rather than one giant app holding every model in the system. This separation keeps models.py files small and focused, lets different apps be tested in isolation, and makes it realistic to eventually extract an app like payments into its own installable package if it needs to be shared across multiple projects.
Cricket analogy: Similar to how a T20 franchise fields separate specialists for powerplay overs, middle overs, and death bowling rather than one bowler doing everything, a Django project splits responsibility across focused apps like accounts, blog, and payments rather than one giant app.
python manage.py startapp blog
# blog/
# migrations/
# admin.py
# apps.py
# models.py
# views.py
# settings.py
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'blog.apps.BlogConfig', # register the new app
]A single Django project commonly contains both first-party apps you write (like blog) and third-party reusable apps installed via pip (like django-allauth), all listed side by side in INSTALLED_APPS.
- A 'project' is the whole site configuration; an 'app' is one focused feature module.
python manage.py startapp bloggenerates models.py, views.py, admin.py, and apps.py.- An app must be added to
INSTALLED_APPSin settings.py before Django recognizes it. - Unregistered apps won't have their models picked up by
makemigrations. - Apps are designed to be modular and, ideally, reusable across projects.
- Splitting functionality into focused apps like
accountsandpaymentskeeps code maintainable. - Third-party apps installed via pip register in
INSTALLED_APPSthe same way first-party apps do.
Practice what you learned
1. What is the key difference between a Django 'project' and a Django 'app'?
2. Which command creates a new Django app?
3. What must happen before Django's migration system will detect an app's models?
4. A beginner writes a new model but `makemigrations` reports no changes. What is the most likely cause?
5. Which file typically references an app's AppConfig class for registration?
Was this page helpful?
You May Also Like
Creating a Django Project
A practical walkthrough of scaffolding a new Django project with django-admin, understanding the generated files, and running the development server for the first time.
The MVT Architecture
How Django splits an application into Models, Views, and Templates, and how the framework itself acts as the controller that wires the three together on every request.
The Django Admin Site
How Django's automatically generated admin interface lets developers and staff manage data through a browser, and how to customize it with ModelAdmin classes.
Related Reading
Related Study Notes in Web Development
Browse all study notesWebSockets Study Notes
Web Development · 30 topics
Web DevelopmentWebAssembly Study Notes
WebAssembly · 30 topics
Web DevelopmentgRPC Study Notes
Protocol Buffers · 30 topics
Web DevelopmentSpring Boot Study Notes
Java · 30 topics
Web DevelopmentFlask Study Notes
Python · 30 topics
Web DevelopmentNext.js Study Notes
JavaScript · 30 topics