Wiki

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 fabfile.prod, 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

/opt/django/
           logs/
                 nginx/
                 projects/
           configs/
                    nginx/
                    supervisord/
           scripts/
           htdocs/
           tmp/

Project correctly cloned

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

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

Virtualenv correctly created

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

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
python
>>> 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

http://192.168.1.1

you must view the nginx message: Welcome to nginx!

Rungunicorn script presence

ls -l /opt/django/scripts/rungunicorn_project_prod.sh
less /opt/django/scripts/rungunicorn_project_prod.sh

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/

Updated