https://github.com/mattmakai/sf-django
Ansible Playbooks and extensive documentation for deploying Django web applications on a Linux, Nginx, PostgreSQL stack.
https://github.com/mattmakai/sf-django
Last synced: 3 months ago
JSON representation
Ansible Playbooks and extensive documentation for deploying Django web applications on a Linux, Nginx, PostgreSQL stack.
- Host: GitHub
- URL: https://github.com/mattmakai/sf-django
- Owner: mattmakai
- License: mit
- Created: 2013-12-10T20:16:09.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-08-07T15:15:21.000Z (almost 8 years ago)
- Last Synced: 2025-02-28T13:24:10.286Z (4 months ago)
- Language: Shell
- Homepage: http://youtu.be/pg-cOPVYKCw?t=17m47s
- Size: 193 KB
- Stars: 80
- Watchers: 8
- Forks: 21
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Deploy Django with Ansible
==========================This project contains an example Ansible Playbook for deploying a Django
project. You should probably use
`underwear `_ to deploy instead of
these files. These files are intended as examples for the
`January 2014 San Fran Django meetup talk `_.
Background
----------
I build a lot of Django apps and I wanted a way to easily deploy them to
a traditional virtual private server stack instead of just defaulting to
Heroku. I previously wrote extensive Fabric scripts to automate the
server configuration and deployment process, but that's really the wrong
tool for this goal. Ansible is a much better way to solve the repeatable
deployment problem.First steps
-----------
Ansible runs over SSH, so we need a way to bootstrap SSH connections through
a non-root user.One way to automate these first few steps is with Fabric. The
fabfile.py.template contains one public function, bootstrap_ansible.
bootstrap_ansible calls the other functions to create a non-root user with
sudo privileges, upload public keys for deployment, and lock down root from
logging in.Copy fabfile.py.template to fabfile.py, fill in the commented fields at
the top of the script, then run the script with::fab bootstrap_ansible
Right now the script will prompt you for the password the non-root user should
be created with. I'll automate that manual step away later.