Clone wiki

django-fagungis / Setup_test

I recommend you to do this checks by hand rather than automatically, so you'll feel more comfortable using django-fagungis.

Assuming you've runned the setup with the default settings present in, you can test its correctness by following these steps on your server:

Dependencies correctly installed

if not already installed on the server, the "setup" task will install all dependencies for you

dpkg -l "mercurial*"
dpkg -l "python-pip*"
dpkg -l "nginx*"
dpkg -l "supervisor*"

Django user exists

getent passwd django

Check folder structure


Project correctly cloned

check if your project have been correctly cloned from your REPOSITORY setted in

cd /opt/django/projects/project_prod/
hg pull -u

Virtualenv correctly created

source /opt/django/envs/project_prod/bin/activate

Project requirements correctly installed

Check if all your requirements from requirements.txt of your project are satisfied, example check gunicorn presence.

source /opt/django/envs/project_prod/bin/activate
>>> import gunicorn
>>> gunicorn.__version__

Check your project nginx configuration

nginx conf file correctly uploaded

less /opt/django/configs/nginx/project_prod.conf
ls -l /etc/nginx/sites-enabled/ | grep project_prod

run nginx test configuration

nginx -t -c /etc/nginx/nginx.conf

check nginx on your browser

you must view the nginx message: Welcome to nginx!

Rungunicorn script presence

ls -l /opt/django/scripts/
less /opt/django/scripts/

Check supervisord

supervisord conf file correctly uploaded

less /opt/django/configs/supervisord/project_prod.conf

supervisord loaded your project

supervisorctl status

probably status will show you that the project process doesn't started, don't worry! The most important thing is that the project is loaded by supervisor, now you must run the deploy fab task to correctly start your project.

Now you're ready to run: fab prod deploy

PS: to redo the setup you must delete your project: rm -rf /opt/django/projects/project_prod/