Dev. Blog isprometheo의 좌충우돌 개발 블로그
Posts with the tag nginx:

[Python] nginx + gunicorn + Django

Django 프로젝트의 settings.py에 다음을 추가한다. STATIC_ROOT = os.path.join(BASE_DIR, 'static') 그리고 다음 명령어를 이용하여 Django에 내장된 static 파일을 지정한 디렉토리에 저장한다. $ python manage.py collectstatic gunicorn 관련된 설정은 공식 문서와 예제 파일을 참고하여 작성한다.

[Python] nginx + Django

Django와 nginx를 연동하기 위해서 flup 라이브러리를 설치한다. $ pip install flup Django 실행은 다음과 같다. $ python manage.py runfcgi method=prefork pidfile=PID_FILE host=127.0.0.1 port=8000 nginx.conf 에 다음과 같이 추가한다. server { listen 80 server_name localhost; location /static/ { #static url autoindex on; root /static/; #static 파일들이 저장된 디렉토리 } location / { #사용