[パイソン]ジャンゴ101



インストール
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

コマンド
# 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の設定
sudo -u postgres psql

postgres=# CREATE DATABASE myproject;
postgres=# CREATE USER myprojectuser WITH PASSWORD 'password';