Created
August 19, 2017 02:30
-
-
Save happychallenge/545ad43eb8af02e65d4f91de904a78b9 to your computer and use it in GitHub Desktop.
Django + uwsgi + nginx 배포 관련
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream myFirstWebApp { | |
server unix:///tmp/myFirstWebApp.sock; | |
} | |
server { | |
listen 8080; | |
server_name localhost; | |
charset utf-8; | |
client_max_body_size 75M; | |
location /static { | |
alias /Users/happy/Django/myFirstWebApp/static; | |
} | |
location /media { | |
alias /Users/happy/Django/myFirstWebApp/media; | |
} | |
location / { | |
uwsgi_pass myFirstWebApp; | |
include /usr/local/etc/nginx/uwsgi_params; | |
} | |
# location / { | |
# include /usr/local/etc/nginx/uwsgi_params; | |
# uwsgi_pass 127.0.0.1:3031; | |
# } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uwsgi] | |
chdir = /Users/happy/Django/myFirstWebApp | |
module = myFirstWebApp.wsgi | |
home = /Users/happy/Django/virtual | |
master = true | |
processes = 2 | |
socket = /tmp/myFirstWebApp.sock | |
chmod-socket = 666 | |
vacuum = true | |
pidfile = /tmp/myFirstWebApp.pid | |
daemonize = uwsgi.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import url | |
from django.contrib import admin | |
from . import views | |
urlpatterns = [ | |
url(r'^admin/', admin.site.urls), | |
url(r'^hello/$', views.greeting, name='greeting'), | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
def greeting(request): | |
return HttpResponse('Hello, XXX') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment