› Forums › Web Development › HarvardX: CS50W – CS50’s Web Programming with Python and JavaScript › CS50W – Lecture 3 – Django › ✅ Django `startapp` + `INSTALLED_APPS` (Q&A)
- This topic is empty.
-
AuthorPosts
-
January 24, 2026 at 10:32 am #5963
Q1) I ran
python manage.py startapp hello. Why do I still need to add'hello'insettings.py?Answer:
Becausestartapponly creates the app files/folder, but Django won’t automatically activate it.To make Django recognize your app, you must register it inside:
INSTALLED_APPS = [ ... 'hello', ]
Q2) What exactly does
startappdo then?Answer:
It generates the app structure like:models.pyviews.pyadmin.pyapps.pytests.pymigrations/
So it gives you the blueprint of the app, but not the permission to run it inside the project.
Q3) What happens if I don’t add my app to
INSTALLED_APPS?Answer:
Django will ignore the app in many important places, such as:✅ Models may not be detected properly
✅ Migrations won’t be created/run correctly
✅ Django Admin won’t show the models
✅ Signals won’t run properly
✅ App configuration won’t loadIn short: your app exists, but Django treats it like it’s not part of the project.
Q4) Why does Django make us add apps manually? Why not auto-register?
Answer (Main reason):
Because Django believes in explicit control over your project.Django makes you do it manually because:
✅ 1) Not every created app is meant to be used
Sometimes developers generate apps for testing, backup, or future features.
Auto-registering could cause confusion or unwanted behavior.
✅ 2) Your project can contain “apps” that are not Django apps
A project folder may contain many directories like:
- utility folders
- scripts
- config folders
- experimental folders
Django should only load the ones you approve.
✅ 3) Performance and startup efficiency
Django loads everything in
INSTALLED_APPSat startup.
Auto-loading every folder would slow down startup and waste resources.
✅ 4) You might want different apps in different environments
Example:
✅ Development environment may include:
- debug toolbar
- test apps
- fake payment gateway app
✅ Production environment should NOT include them.
Manual control makes this flexible and safe.
✅ 5) Avoid conflicts and unintended side effects
Apps can contain:
- signals
- middleware hooks
- database models
- admin registrations
Auto-registering can trigger unexpected things during runtime.
So Django forces you to opt-in.
Q5) What is the best way to add the app in
INSTALLED_APPS?Answer:
Use the AppConfig path (recommended):INSTALLED_APPS = [ ... 'hello.apps.HelloConfig', ]It ensures Django loads the app in a clean, configurable way.
Q6) Simple explanation for beginners?
Answer:
✅startapp= “Create the app”
✅INSTALLED_APPS= “Enable the app”Just like installing an app on your phone doesn’t mean it’s allowed to run automatically until you open/enable it.
-
AuthorPosts
- You must be logged in to reply to this topic.

