Cheat Sheet - Sloathking/Foolish-Wizardz GitHub Wiki

Django

to activate venv

source  <venv name>/Scripts/activate

running django server

./manage.py runserver

migrate database

py -3 manage.py makemigrations

then

py -3 manage.py migrate

django superuser creation

python manage.py createsuperuser

If that does not run due to windows being rude use:

winpty python manage.py createsuperuser

create venv

py -3 -m venv djvenv

Install django

Ensure version 4.2.

pip install django==4.2

django project quick start

django-admin startproject django_project

upgrade pip

# upgrade pip
py -3 -m pip install --upgrade pip
# also run this to be safe
python.exe -m pip install --upgrade pip

Git and Github

General work flow

#at the start of the work day
git pull
git checkout <branch name>
#or
git checkout -b <branch name> #create and switch to branch

#do your work
git add .
git commit -m"work description"
git push
⚠️ **GitHub.com Fallback** ⚠️