https://github.com/quansight/ansible-django-do-tutorial
An Ansible tutorial for deploying a Django app on Digital Ocean
https://github.com/quansight/ansible-django-do-tutorial
Last synced: 11 months ago
JSON representation
An Ansible tutorial for deploying a Django app on Digital Ocean
- Host: GitHub
- URL: https://github.com/quansight/ansible-django-do-tutorial
- Owner: Quansight
- Created: 2020-05-27T16:15:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T23:30:54.000Z (over 3 years ago)
- Last Synced: 2025-08-11T05:56:55.888Z (11 months ago)
- Language: Shell
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ansible Tutorial
A basic Django app with postgres as database deployed on DigitalOcean (droplet) via Ansible.
## Environment variables
Create a `.env` file in the root of the cloned repository, with following variables:
```bash
POSTGRES_DB=sample
POSTGRES_USER=postgres
POSTGRES_PASSWORD="set strong password for postgres"
SUPERUSER_PASSWORD="set strong password for django admin dashboard"
DO_API_TOKEN="Digital Ocean token, if deploying"
```
## Running the app
To run the app install `docker` and `docker-compose`. Build and run the
app with following commands:
```bash
docker-compose build
```
```bash
docker-compose up
```
After running the commands above, the app should be running at:
http://127.0.0.1:8000/
## Deployment
This is deployed on Digital Ocean Droplet via Ansible. To deploy run the
following command after `docker-compose up`:
```bash
docker-compose exec web ansible-playbook deployment/site.yml
```