Browse files

Gunicorn FTW.

  • Loading branch information...
1 parent 129b404 commit 7bf8c26cdfaa0d46b68d144f1161558157132582 @jacobian jacobian committed Oct 22, 2010
Showing with 38 additions and 3 deletions.
  1. +15 −0 django.me.init.conf
  2. +18 −0 fabfile.py
  3. +4 −2 requirements.txt
  4. +1 −1 settings.py
View
15 django.me.init.conf
@@ -0,0 +1,15 @@
+# run django.me under gunicorn
+
+start on runlevel [23]
+stop on runlevel 1
+stop on shutdown
+respawn
+script
+ /home/web/venvs/djangome/bin/python /home/web/djangome/manage.py run_gunicorn \
+ --bind=127.0.0.1:8002 \
+ --user=www-data \
+ --group=www-data \
+ --pid=/var/run/djangome.pid \
+ --workers=4 \
+ --name=djangome
+end script
View
18 fabfile.py
@@ -0,0 +1,18 @@
+import unipath
+from fabric.api import *
+from fabric.contrib import project
+
+env.hosts = ['jacobian.org']
+env.user = 'root'
+env.venv = unipath.Path('/home/web/venvs/djangome')
+env.deployroot = unipath.Path('/home/web/djangome')
+
+def deploy():
+ deploy_code()
+ update_deps()
+
+def deploy_code():
+ project.rsync_project(env.deployroot.parent, delete=True, exclude=['*.pyc'])
+
+def update_deps():
+ run('%s/bin/pip install -r %s/requirements.txt' % (env.venv, env.deployroot))
View
6 requirements.txt
@@ -1,4 +1,6 @@
+gunicorn
Sphinx
Unipath
--e svn+http://code.djangoproject.com/svn/django/trunk#egg=Django
--e git+git://github.com/andymccurdy/redis-py.git#egg=redis
+-e svn+http://code.djangoproject.com/svn/django/trunk@14317#egg=Django
+-e git+git://github.com/andymccurdy/redis-py.git#egg=redis
+-e git+git://git.fabfile.org/fabric.git#egg=Fabric
View
2 settings.py
@@ -17,7 +17,7 @@
SECRET_KEY = 'b2@r_iu-3@#dm6+b2nt-iyu0n6#1j&!zt2a+3hw%9!_1k9!(2b'
ROOT_URLCONF = 'djangome.urls'
-INSTALLED_APPS = ['djangome']
+INSTALLED_APPS = ['djangome', 'gunicorn']
TEMPLATE_DIRS = [BASE.child('templates')]
REDIS = {

0 comments on commit 7bf8c26

Please sign in to comment.