{"id":21374971,"url":"https://github.com/aoxborrow/dvang","last_synced_at":"2026-04-13T03:04:27.083Z","repository":{"id":141231020,"uuid":"203267528","full_name":"aoxborrow/dvang","owner":"aoxborrow","description":"Django-Vagrant-Ansible-Nginx-Gunicorn Starter Pack","archived":false,"fork":false,"pushed_at":"2019-09-10T18:20:45.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T08:40:35.685Z","etag":null,"topics":["ansible","django","gunicorn","nginx","postgres","postgresql","python","vagrant"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aoxborrow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-20T00:00:00.000Z","updated_at":"2022-08-17T08:52:01.000Z","dependencies_parsed_at":"2024-01-22T20:27:42.041Z","dependency_job_id":null,"html_url":"https://github.com/aoxborrow/dvang","commit_stats":null,"previous_names":["aoxborrow/dvang"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoxborrow%2Fdvang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoxborrow%2Fdvang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoxborrow%2Fdvang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aoxborrow%2Fdvang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aoxborrow","download_url":"https://codeload.github.com/aoxborrow/dvang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243848162,"owners_count":20357503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","django","gunicorn","nginx","postgres","postgresql","python","vagrant"],"created_at":"2024-11-22T08:46:17.835Z","updated_at":"2026-04-13T03:04:27.050Z","avatar_url":"https://github.com/aoxborrow.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"DVANG\n=======\n\n### Django-Vagrant-Ansible-Nginx-Gunicorn *Starter Pack*\n\nThis is a starter pack for quickly developing a Django project locally with Vagrant, which is then easily deployed into production with Ansible. It installs and configures all the services you'll need:\n - **Vagrant** VM based on **Ubuntu 18.04**\n - **Python 3.6** virtualenv for your **Django** app and its dependencies\n - **Nginx** to serve static files and proxy to **Gunicorn**\n - **Supervisor** to automatically start/restart Gunicorn\n - **PostgreSQL** with database and initial Django migrations\n - Minimal Django configuration with **Django Admin** and **Debug Toolbar**\n - **Node.js** for installing front-end components *(optional)*\n\n### Features\n- Disposable environment is fully self-contained within the Vagrant VM\n- Ansible playbooks for both local development and production\n- Develop with Django dev server, then test/deploy with Gunicorn/Nginx\n- Easily add Ansible galaxy roles *(ansible/requirements.yml)*\n- Activates Python virtualenv on login\n- Installs Python packages from `requirements.txt`\n- Installs Node packages from `package.json`\n- Configure environment-specific Django settings in `settings_local.py`\n\n### Shortcuts\n- `activate` - activate the virtualenv \n- `deactivate` - deactivate the virtualenv \n- `make run` - run Django development server \n- `make migrate` - makemigrations and migrate \n- `make load` - load fixtures \n- `make collect` - collect static files \n- `make restart` - start/restart Gunicorn \u0026 Nginx\n- `make provision-dev` - run playbook for dev *(must deactivate virtualenv)*\n- `make provision-prod` - run playbook production *(must deactivate virtualenv)*\n----\n\n### Local Development\n\n0. Install [Vagrant](https://www.vagrantup.com/)\n\n0. Clone this repo as your project name: **(This is important, the project folder name will be used for configuring database name, hostname, etc.)**\n    ```sh\n    git clone git@github.com:paste/dvang.git my-project-name\n    ```\n\n0. Build your Vagrant VM:\n\n    ```sh\n    vagrant up\n    ```\n\n0. Log into the VM via SSH:\n    ```sh\n    vagrant ssh\n    ```\n\n0. Start Django development server:\n    ```sh\n    cd my-project-name\n    make run\n    ```\n\n0. Modify your computer's local `/etc/hosts`:\n\n    ```\n    192.168.33.55   my-project-name.local\n    ```\n\n0. Visit your app:\n    ```\n    http://my-project-name.local\n    ```\n\n0. Login to Django Admin with user/pass: **admin/admin**:\n    ```\n    http://my-project-name.local/admin\n    ```\n\n\n0. **Profit** :heavy_check_mark:\n\n\n----\n\n### In Production\n\n0. You'll need a remote user with `sudo` privileges to run Ansible.\n\n0. Edit the `host_name` and other settings in `ansible/prod.yml` as necessary.\n\n0. Clone your project onto the server in your remote user's home folder, e.g. `~/my-project-name`\n\n0. Install Ansible with the included script:\n    ```sh\n    cd ~/my-project-name\n    sudo ansible/install.sh\n    ```\n\n0. Install Ansible Galaxy roles:\n    ```sh\n    make install-galaxy-roles\n    ```\n\n0. Run the Ansible production playbook:\n    ```sh\n    make provision-prod\n    ```\n\n0. Activate the virtualenv:\n    ```sh\n    # after this you can use \"activate\" and \"deactivate\" shortcuts\n    source ~/.bashrc\n    ```\n\n0. Apply Django migrations:\n    ```sh\n    make migrate\n    ```\n\n0. Load Django fixtures:\n    ```sh\n    make load\n    ```\n\n0. Collect Django static files:\n    ```sh\n    make collect\n    ```\n\n0. **Profit** :heavy_check_mark:\n\n\n----\n\n### HTTPS in Production\n\n0. To use HTTPS you will need an SSL certificate. Get one from Certbot here: https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx\n\n0. Copy the certificate and key to your remote user's home folder. The Nginx configuration expects the files to be named after the `host_name`, like this:  \n    ```\n    ~/dvang.io.crt\n    ~/dvang.io.key\n    ```\n\n0. Update the production playboook to use SSL, in `ansible/prod.yml`:  \n    ```yaml\n    nginx_use_ssl: true\n    ```\n\n0. Enable SSL features for Django, in `src/settings_local.py`:  \n    ```py\n    # this enables secure cookies, HTTP redirect, etc.\n    USE_SSL = True\n    ```\n\n0. Re-run the Ansible production playbook:\n    ```sh\n    make provision-prod\n    ```\n\n0. **Profit** :heavy_check_mark:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxborrow%2Fdvang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoxborrow%2Fdvang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxborrow%2Fdvang/lists"}