User Management
Reset admin password
python manage.py changepassword <user_name>
Database Management
Migrate data between different databases
# Make sure settings.py points to source database
# Dump data
python manage.py dumpdata --all --format json --indent 2 --output C:\Temp\Fulldump.json
# Reconfigure settings.py so it points to target database!!!!
# Generate schema on target database
python manage.py migrate
# Reload data
python manage.py loaddata --verbosity 3 --format json C:\Temp\Fulldump.json
Create a migration
python manage.py makemigrations polls
python manage.py migrate
Dump current configuration (including defaults)
python manage.py diffsettings --all
See what SQL script a migration would run
python manage.py sqlmigrate polls 0001
Project management
Scaffold new project
django-admin startproject mysite
Manage.py commands
Start server
py manage.py runserver
Initiate database migration
py manage.py migrate
Create an app inside a project
py manage.py startapp polls
MSSQL Backend
mssql-backend
django-mssql-backend
- It doesn't fully work with the latest 3.2.5 version (py manage.py sqlmigrate throws exceptions, which are gone with 2.2.24)
- Lacks AAD support
django-mssql-backend-azure
- Does work with Django 2.2.24
- Doesn't work with Django 3.2.5, 3.1.13