Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/buildwithlal/django-nginx-uwsgi-ansible

Deploy Django with Postgres on Nginx and uWSGI using Ansible
https://github.com/buildwithlal/django-nginx-uwsgi-ansible

ansible-playbook ansible-roles django nginx uwsgi

Last synced: 3 months ago
JSON representation

Deploy Django with Postgres on Nginx and uWSGI using Ansible

Awesome Lists containing this project

README

        

### Deploy Django and Postgres on Nginx and uWSGI
We are using Vagrant and Ansible to deploy Django application on Vagrant box but you can reuse same ansible playbook to deploy on any other Ubuntu server 14.04. We are using Python virtualenv to deploy Django application.

Nginx is acting as a reverse proxy, handling `/static/` and `/media/` contents.

uWSGI is serving Django application

####Enviroment
```
1. Vagrant=1.8
2. Ansible=2.1
3. Ubuntu Server=14.04 trusty
4. Python=2.7
5. Django=1.10
6. Postgresql=9.4
7. Nginx
8. uWSGI
```

####NOTE:
1. Update `Vagrantfile` to change your synced_folders.
```
config.vm.synced_folder "./mysite", "/var/www/mysite"
```
2. Update `inventory.ini` to replace your server IP or host name instead of `web`
3. Update `shared_vars.main`, `/roles/setup/vars/main.yml`, `/roles/deploy/vars/main.yml` and `/roles/setup/templates`
to make your desired changes i.e http port, django settings module, project dir, Nginx and uWSGI logs etc

####Using Vagrant
```
# Switch to directory and run command to create machine and run provisions
vagrant up

# run provisions if machine is already created
vagrant provisions

```

####Using Ansible directly
Switch to directory and run command to run provisions on machine listed in inventory.ini
```
ansible-playbook -i inventory.ini site.yml
```