Every Django site begins with two commands: startproject creates the config shell; startapp creates a feature module you plug into the project.
Creating a project
django-admin startproject mysite
cd mysite
python manage.py startapp blog
Typical layout
mysite/
manage.py # CLI entry point
mysite/
__init__.py
settings.py # configuration
urls.py # root URLconf
wsgi.py # deployment entry
blog/
models.py
views.py
urls.py
admin.py
migrations/
Register the app
Add 'blog.apps.BlogConfig' (or 'blog') to INSTALLED_APPS in settings.py, then wire URLs with include().
Important interview questions and answers
- Q: Project vs app?
A: Project is the whole site configuration; apps are reusable modules (blog, accounts) that can live in multiple projects. - Q: What does manage.py do?
A: SetsDJANGO_SETTINGS_MODULEand delegates to Django's command-line utility—runserver, migrate, shell, etc. - Q: Can you rename an app later?
A: Possible but painful—migrations and imports break; choose names carefully upfront.
Self-check
- Which command creates
manage.py? - Where do you register a new app?
Interview prep
- Project vs app?
Project is site configuration (settings, root URLs); apps are reusable modules (blog, accounts) with models and views plugged into INSTALLED_APPS.