Skip to content

Commit

Permalink
Gunicorn FTW.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobian committed Oct 22, 2010
1 parent 129b404 commit 7bf8c26
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
15 changes: 15 additions & 0 deletions django.me.init.conf
Original file line number Original file line Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions fabfile.py
Original file line number Original file line Diff line number Diff line change
@@ -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))
6 changes: 4 additions & 2 deletions requirements.txt
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,6 @@
gunicorn
Sphinx Sphinx
Unipath Unipath
-e svn+http://code.djangoproject.com/svn/django/trunk#egg=Django -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://github.com/andymccurdy/redis-py.git#egg=redis
-e git+git://git.fabfile.org/fabric.git#egg=Fabric
2 changes: 1 addition & 1 deletion settings.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
SECRET_KEY = 'b2@r_iu-3@#dm6+b2nt-iyu0n6#1j&!zt2a+3hw%9!_1k9!(2b' SECRET_KEY = 'b2@r_iu-3@#dm6+b2nt-iyu0n6#1j&!zt2a+3hw%9!_1k9!(2b'


ROOT_URLCONF = 'djangome.urls' ROOT_URLCONF = 'djangome.urls'
INSTALLED_APPS = ['djangome'] INSTALLED_APPS = ['djangome', 'gunicorn']
TEMPLATE_DIRS = [BASE.child('templates')] TEMPLATE_DIRS = [BASE.child('templates')]


REDIS = { REDIS = {
Expand Down

0 comments on commit 7bf8c26

Please sign in to comment.