{"id":23637033,"url":"https://github.com/ansibleguy/infra_django_apache","last_synced_at":"2025-08-31T12:30:29.767Z","repository":{"id":53920709,"uuid":"423998738","full_name":"ansibleguy/infra_django_apache","owner":"ansibleguy","description":"Ansible Role to provision Django sites","archived":false,"fork":false,"pushed_at":"2024-08-05T19:54:07.000Z","size":91,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"latest","last_synced_at":"2024-08-05T23:08:03.352Z","etag":null,"topics":["ansible","ansible-role","automation","django","iac","infrastructure-as-code","mariadb","postgresql","python3","webserver"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ansibleguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"ansible0guy","github":"ansibleguy"}},"created_at":"2021-11-02T21:05:26.000Z","updated_at":"2024-08-05T19:54:10.000Z","dependencies_parsed_at":"2023-02-15T17:16:09.060Z","dependency_job_id":"e195e2ed-22e6-4bc5-98f7-cde5ee8ad3c1","html_url":"https://github.com/ansibleguy/infra_django_apache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansibleguy%2Finfra_django_apache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansibleguy%2Finfra_django_apache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansibleguy%2Finfra_django_apache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ansibleguy%2Finfra_django_apache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ansibleguy","download_url":"https://codeload.github.com/ansibleguy/infra_django_apache/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231590686,"owners_count":18396934,"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","ansible-role","automation","django","iac","infrastructure-as-code","mariadb","postgresql","python3","webserver"],"created_at":"2024-12-28T06:17:29.784Z","updated_at":"2025-08-31T12:30:29.689Z","avatar_url":"https://github.com/ansibleguy.png","language":"Jinja","funding_links":["https://ko-fi.com/ansible0guy","https://github.com/sponsors/ansibleguy"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.djangoproject.com\"\u003e\n\u003cimg src=\"https://static.djangoproject.com/img/logos/django-logo-negative.svg\" alt=\"Django Logo\" width=\"300\"/\u003e\n\u003c/a\u003e\n\n# Ansible Role - Python3 Django\n\nAnsible Role to deploy one or multiple Django applications on a linux server using Apache2 as webserver.\n\n[![Lint](https://github.com/ansibleguy/infra_django_apache/actions/workflows/lint.yml/badge.svg)](https://github.com/ansibleguy/infra_django_apache/actions/workflows/lint.yml)\n[![Ansible Galaxy](https://badges.ansibleguy.net/galaxy.badge.svg)](https://galaxy.ansible.com/ui/standalone/roles/ansibleguy/infra_django_apache)\n\n**Molecule Integration-Tests**:\n\n* Status: [![Molecule Test Status](https://badges.ansibleguy.net/infra_django_apache.molecule.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/molecule.sh.j2) |\n[![Functional-Tests](https://github.com/ansibleguy/infra_django_apache/actions/workflows/integration_test_result.yml/badge.svg)](https://github.com/ansibleguy/infra_django_apache/actions/workflows/integration_test_result.yml)\n* Logs: [API](https://ci.ansibleguy.net/api/job/ansible-test-molecule-infra_django_apache/logs?token=2b7bba30-9a37-4b57-be8a-99e23016ce70\u0026lines=1000) | [Short](https://badges.ansibleguy.net/log/molecule_infra_django_apache_test_short.log) | [Full](https://badges.ansibleguy.net/log/molecule_infra_django_apache_test.log)\n\nInternal CI: [Tester Role](https://github.com/ansibleguy/_meta_cicd) | [Jobs API](https://github.com/O-X-L/github-self-hosted-jobs-systemd)\n\n**Tested:**\n* Debian 11\n* Debian 12\n\n----\n\n## Install\n\n```bash\n# latest\nansible-galaxy role install git+https://github.com/ansibleguy/infra_django_apache\n\n# from galaxy\nansible-galaxy install ansibleguy.infra_django_apache\n\n# or to custom role-path\nansible-galaxy install ansibleguy.infra_django_apache --roles-path ./roles\n\n# install dependencies\nansible-galaxy install -r requirements.yml\n```\n\n----\n\n## Advertisement\n\n* Need **professional support** using Ansible or managing Web-Applications? Contact us:\n\n  E-Mail: [contact@oxl.at](mailto:contact@oxl.at)\n\n  Tel: [+43 3115 40 900 0](tel:+433115409000)\n\n  Web: [EN](https://www.o-x-l.com) | [DE](https://www.oxl.at)\n\n  Language: German or English\n\n* You want a simple **Ansible GUI**?\n\n  Check-out this [Ansible WebUI](https://github.com/ansibleguy/webui)\n\n----\n\n## Usage\n\n### Config\n\nYou need to define your instances by configuring the 'mariadb' dictionary!\n\n```yaml\ndjango:\n  sites:\n    niceApp:\n      domain: 'django.ansibleguy.net'\n      project: 'super'  # the directory containing the 'settings.py' is named like this \n      \n      sync_code:  # sync's local code to the remote server\n        enabled: true\n        src: '/home/ansibleguy/code/niceApp'\n        static_src: '/home/ansibleguy/code/niceApp_static'\n      \n      venv: '/var/lib/niceApp'\n\n      python_modules:\n        present: ['netaddr', 'pycryptodome']\n      \n      env_pythonpath: ['/var/lib/myOtherApp']  # will get added to django's PYTHONPATH environmental variable\n\n      ssl:\n        mode: 'letsencrypt'\n\n      letsencrypt:\n        email: 'django@template.ansibleguy.net'\n```\n\nYou might want to use 'ansible-vault' to encrypt your passwords:\n```bash\nansible-vault encrypt_string\n```\n\n### Execution\n\nRun the playbook/role:\n```bash\nansible-playbook -K -D -i inventory/hosts.yml django.yml --ask-vault-pass\n```\n\nThere are also some useful **tags** available:\n* base =\u003e only configure basics; instances will not be touched\n* sites\n* config\n* db\n* sync =\u003e only sync local code to remote host (_if enabled by user_)\n* django =\u003e don't start sub-roles for apache and/or mariadb\n\nTo debug errors - you can set the 'debug' variable at runtime:\n```bash\nansible-playbook -K -D -i inventory/hosts.yml playbook.yml -e debug=yes\n```\n\n----\n\n## Functionality\n\n* **Package installation**\n  * Ansible dependencies (_minimal_)\n\n\n* **Configuration**\n  * Apache using [THIS](https://github.com/ansibleguy/infra_apache) role\n  * Support for MySQL or PostgreSQL\n\n  * **Default opt-in**:\n    * MariaDB database using [THIS](https://github.com/ansibleguy/infra_mariadb) role\n\n\n  * **Default opt-outs**:\n    * Database backup service\n    * Special apache config =\u003e can be passed using the 'django' dictionary\n    * Running 'collectstatic'\n\n\n  * **Default config**:\n    * A Self-Signed certificate will be used\n    * Database type =\u003e MariaDB\n      * Database will be installed automatically \n    * Using a python virtual environment\n    * A database migration script will be created in the venv directory\n\n----\n\n## Info\n\n* **Note:** this role currently only supports debian-based systems\n\n\n* **Note:** Most of the role's functionality can be opted in or out.\n\n  For all available options - see the default-config located in the main/site defaults-file!\n\n\n* **Warning:** Not every setting/variable you provide will be checked for validity. Bad config might break the role!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansibleguy%2Finfra_django_apache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fansibleguy%2Finfra_django_apache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fansibleguy%2Finfra_django_apache/lists"}