docker-compose run web python manage.py makemigrations
docker-compose run web python manage.py migrate
docker-compose run web python manage.py createsuperuser
-
起動
docker-compose up -d -
開発状況を確認
http://127.0.0.1:8000 -
管理画面を確認
http://127.0.0.1:8000/admin -
停止 docker-compose stop
-
startproject docker-compose run web django-admin.py startproject config .
-
settingのdbを変更
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'postgres', 'USER': 'postgres', 'HOST': 'db', 'PORT': 5432, } }
-
startapp docker-compose run web django-admin.py startapp core .
-
makemigrations docker-compose run web python manage.py makemigrations
-
migrate docker-compose run web python manage.py migrate
-
createsuperuser
-
settings.pyの書き換え 本番運用を想定したDjango settings.pyの書き方入門
https://speakerdeck.com/ryu22e/ben-fan-yun-yong-woxiang-ding-sitadjango-settings-dot-pyfalseshu-kifang-ru-men
Django の settings を切り替えるようにした話
https://qiita.com/ukisoft/items/8912d0a66151609d9ff9