Commit e4ca4dcb0c042c5119d065f1439f1fe87dd37848
1 parent
5c344b8a0b
Exists in
master
Integrated newrelic into the module to allow for touch reloads
Showing 2 changed files with 3 additions and 1 deletions Inline Diff
flashy/wsgi_django.py
View file @
e4ca4dc
import os | 1 | 1 | import os | |
2 | import newrelic.agent | |||
3 | newrelic.agent.initialize('/some/path/newrelic.ini') | |||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "flashy.settings") | 2 | 4 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "flashy.settings") | |
from django.core.wsgi import get_wsgi_application | 3 | 5 | from django.core.wsgi import get_wsgi_application | |
application = get_wsgi_application() | 4 | 6 | application = get_wsgi_application() |
scripts/run_production.sh
View file @
e4ca4dc
#!/bin/bash -xe | 1 | 1 | #!/bin/bash -xe | |
source secrets.sh | 2 | 2 | source secrets.sh | |
source venv/bin/activate | 3 | 3 | source venv/bin/activate | |
# newrelic-admin run-program /srv/flashy-backend/venv/bin/gunicorn --pid /run/flashy/gunicorn.pid -w 6 -n flashy -b 127.0.0.1:7002 flashy.wsgi | 4 | 4 | # newrelic-admin run-program /srv/flashy-backend/venv/bin/gunicorn --pid /run/flashy/gunicorn.pid -w 6 -n flashy -b 127.0.0.1:7002 flashy.wsgi | |
# Run the scripts with 'exec' so they're tracked by upstart properly | 5 | 5 | # Run the scripts with 'exec' so they're tracked by upstart properly | |
exec uwsgi /etc/uwsgi/websocket.ini --touch-reload=/etc/uwsgi/websocket.ini & | 6 | 6 | exec uwsgi /etc/uwsgi/websocket.ini --touch-reload=/etc/uwsgi/websocket.ini & | |
exec newrelic-admin run-program uwsgi /etc/uwsgi/flashy.ini --touch-reload=/etc/uwsgi/flashy.ini | 7 | 7 | exec uwsgi /etc/uwsgi/flashy.ini --touch-reload=/etc/uwsgi/flashy.ini | |
8 | 8 |