1.manage.py
manage.py wraps django-admin, generated once by startproject. It auto-sets DJANGO_SETTINGS_MODULE, so `python manage.py runserver` needs no flags but bare `django-admin runserver` does.
Key features
- Generated once by `django-admin startproject`, at the project root
- Automatically sets DJANGO_SETTINGS_MODULE — no --settings flag needed
- Runs the exact same commands as django-admin (runserver, migrate, ...)
- `python manage.py test` and `python manage.py shell` are the other two used daily
- Also usable as `python -m django`, with the same settings-detection behavior
manage.py vs. plain django-admin
- django-admin — generic, needs --settings
- startproject — generates manage.py
- manage.py — settings already wired in
Command
python manage.py runserver
python manage.py migrate
python manage.py shell
python manage.py testmanage.py = django-admin with DJANGO_SETTINGS_MODULE pre-set to this project — same commands, no --settings flag needed.