Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 979 Bytes

python.md

File metadata and controls

47 lines (36 loc) · 979 Bytes

django

# install dependencies
pip install Django pylint pylint-django

# create new project
django-admin startproject '<PROJECT_NAME>'

# add sub-app to project
python manage.py startapp '<APP_NAME>'

# start server
python manage.py runserver

# create migration
python manage.py makemigrations

# migrate db
python manage.py migrate

# create superuser for admin panel
python manage.py createsuperuser

# collect static files into one folder
python manage.py collectstatic

gunicorn

# restart a gunicorn service
sudo systemctl restart gunicorn

twine

# generate distribution files (from within project's root folder)
python -m build # requires build package - pip install build

# upload generated distribution files to pypi
twine upload '<DIST_FOLDER_WITH_GENERATED_PACKAGES>'/*

pip

# Create an editable install that works with vscode/pylance
pip install -e '<PATH_TO_PKG_DIR>' --config-settings editable_mode=compat