Recently I've started working a lot with Django (this website plus a few other projects I have in the works), but I am always forgetting a couple of the commands and have to look them up.
So I thought I would gather the commands I forget together (plus the other basic commands for completion) so I have a place to look them up quickly, and thought they might be useful to others as well.
Creating a virtual environment:
python -m venv <path>
Activate the virtual environment:
pip install Django
Create a project:
django-admin startproject <project name>
Create an app:
python manage.py startapp <app name>
Prep the DB migration:
python manage.py makemigrations <(optional) list of apps>
Migrate the DB changes:
python manage.py migrate <(optional) list of apps>
Creating the super user:
python manage.py createsuperuser
Reset a user's password:
python manage.py changepassword <username>
Run the project:
python manage.py runserver <(optional) server details>
Server details can just be the port (default 8000), or address and port in the form 127.0.0.1:8000 -
localhost is also a valid value for address.
Run the shell:
python manage.py shell