Skip to content

Commit

Permalink
Merge branch 'hotfix/v0.1.0-production'
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYang0529 committed Oct 9, 2016
2 parents dcb038d + 513e42f commit 104ee93
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dengue/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,14 @@ Install Redis
### Local Server

python manage.py runserver --settings=dengue.settings.local

### Production Server

uwsgi --ini dengue.ini


## Stop Server

### Production Server

sudo killall -s INT uwsgi
14 changes: 14 additions & 0 deletions dengue/dengue.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[uwsgi]
chdir = /home/ubuntu/dengue-backend/dengue
wsgi-file = /home/ubuntu/dengue-backend/dengue/dengue/wsgi.py

processes = 4
master=True

# socket = /var/run/linebot.sock
socket = :8000
chmod-socket = 666
pidfile=/tmp/dengue-backend.pid
vacuum=True
max-requests=5000
daemonize=/var/log/uwsgi/dengue-backend.log
4 changes: 4 additions & 0 deletions dengue/dengue/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import json

from .base import *

from django.core.exceptions import ImproperlyConfigured

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

Expand Down
2 changes: 1 addition & 1 deletion dengue/dengue/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dengue.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dengue.settings.production")

application = get_wsgi_application()

0 comments on commit 104ee93

Please sign in to comment.