Ferraganchos & Pinchos

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

Archive for the category “Uncategorized”

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

Post Navigation