Ferraganchos & Pinchos

Or how to rip all this stuff out of my head…

Pinax deployment with gunicorn and supervisor

Here is my recipe for Pinax deployment using Python tools as much as possible.

Create virtualmenv and activate it.

virtualenv –no-site-packages myenv
cd myenv/
source bin/activate

Install Pinax from GitHub.

pip install git+git://github.com/pinax/pinax.git

Setup basic pinax project.

pinax-admin setup_project -b basic mypinax

Test the project.

cd mypinax/
python manage.py syncdb
python manage.py runserver

Install gunicorn and test the installation

pip install gunicorn
gunicorn wsgi:application

Setup supervisor.

sudo apt-get install supervisor

Configure mypinax app in /etc/supervisor/conf.d/mypinax.conf

[program:mypinax]
command=/home/xulioc/virtualenv/myenv/bin/gunicorn wsgi:application
directory=/home/xulioc/virtualenv/myenv/mypinax/
user=xulioc
autostart=true
autorestart=true
redirect_stderr=True

Restart supervisor.

sudo /etc/init.d/supervisor/stop
sudo /etc/init.d/supervisor/start

Enjoy!

Advertisements

Single Post Navigation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: