1시작 명령
manage.py 만 있으면 개발 서버로 뜨므로 운영에서는 gunicorn 을 쓰세요 (requirements.txt 에 gunicorn 추가).
bashpython manage.py migrate && gunicorn mysite.wsgi --bind 0.0.0.0:$PORT --workers 22PostgreSQL 연결
같은 프로젝트에 postgres 를 만들고 참조 변수로 넣습니다. dj-database-url 로 읽으면 됩니다.
bashoc db create postgres --name db oc variables set DATABASE_URL='${{db.DATABASE_URL}}' oc variables set ALLOWED_HOSTS='*'3배포 방법 (셋 중 하나)
① GitHub 연결: 프로젝트 → 서비스 추가 → GitHub 저장소 (push 하면 자동 배포) ② 이 폴더 그대로: oc up --wait (Dockerfile 이 없어도 언어를 감지해 빌드) ③ 콘솔에서 폴더 · zip 올리기: 서비스 추가 → 소스 올리기
bashoc login oc project create my-app --link oc up --wait