Skip to content

gotoh-poclab/docker-django-test-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker_django

初回

docker-compose run web python manage.py makemigrations

docker-compose run web python manage.py migrate

docker-compose run web python manage.py createsuperuser

毎回の操作方法

最初から作成する方法

  1. startproject docker-compose run web django-admin.py startproject config .

  2. settingのdbを変更

DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql', 'NAME': 'postgres', 'USER': 'postgres', 'HOST': 'db', 'PORT': 5432, } }

  1. startapp docker-compose run web django-admin.py startapp core .

  2. makemigrations docker-compose run web python manage.py makemigrations

  3. migrate docker-compose run web python manage.py migrate

  4. createsuperuser

  5. 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published