Skip to content
Browse files

Merge pull request #4 from cyberj/master

Some tips for gunicorn
  • Loading branch information...
2 parents 9096aa0 + 9d28de7 commit 9cad4a3e9d980915dd752a684abf6cc4012b555a @jbl2024 committed
Showing with 18 additions and 0 deletions.
  1. +5 −0 sample_project/deploy/__init__.py
  2. +13 −0 sample_project/deploy/runit.example.sh
View
5 sample_project/deploy/__init__.py
@@ -0,0 +1,5 @@
+# REALLY UGLY THING
+# =================
+from os.path import abspath, dirname, join
+deploy = join(abspath(dirname(__file__)), 'deploy.wsgi')
+execfile(deploy)
View
13 sample_project/deploy/runit.example.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+GUNICORN=../vtenv/bin/gunicorn
+PID=/var/run/django_sample_env.pid
+USER=user
+APP=deploy
+DIR=/path/to/application
+
+if [ -f $PID ]; then rm $PID; fi
+
+cd $DIR
+exec sudo -H -u $USER DJANGO_MODE="development" $GUNICORN $APP
+#exec sudo -H -u cyberj $GUNICORN --pid=$PID $APP

0 comments on commit 9cad4a3

Please sign in to comment.
Something went wrong with that request. Please try again.