Install
python3 -m venv ./venv
source ./venv/bin/activate
# Escape from venv
deactivate
# Check packages installed in the venv
pip freeze
# Create project & app
pip install django
django-admin startproject PROJECT-NAME
python manage.py start app APP-NAME
Commands
# Run server
python manage.py runserver
# Create migrations
python manage.py makemigrations
# Run migration
python manage.py migrate
# Collect static files
python manage.py collectstatic
Postgres DB setup
sudo -u postgres psql
postgres=# CREATE DATABASE myproject;
postgres=# CREATE USER myprojectuser WITH PASSWORD 'password';
Top comments (0)