Skip to content

/cheatsheets/django/django-manage-py-cheat-sheet

Django manage.py cheat sheet: project, migrations, users, testing

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash)updated 2026-10-20
tool
Django
versions
Django 6.x
os
any

manage.py is the per-project command line for Django: it sets DJANGO_SETTINGS_MODULE and runs django-admin subcommands. Every command takes --help.

A new project, checked

bash
django-admin startproject mysite . >/dev/null
python manage.py startapp blog
python manage.py check
python manage.py migrate -v 0
python manage.py showmigrations auth | head -4

Output

System check identified no issues (0 silenced).
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length

Project and apps

CommandWhat it does
django-admin startproject mysite .new project in the current folder
python manage.py startapp blognew app (add it to INSTALLED_APPS)
python manage.py runserver 0.0.0.0:8000development server on all interfaces
python manage.py check --deployproduction settings checklist

Database

CommandWhat it does
makemigrationscreate migrations from model changes
migrateapply migrations
showmigrationsapplied and pending migrations
sqlmigrate app 0001SQL of one migration
dbshellopen the database client
dumpdata app --indent 2 > data.jsonexport data as fixtures
loaddata data.jsonimport fixtures

Users, shell, tests, static files

CommandWhat it does
createsuperuseradmin user (interactive)
changepassword alicereset a password
shellPython shell with the project loaded
test blog --parallelrun tests of an app
collectstatic --noinputgather static files into STATIC_ROOT

Sources