{"id":24072657,"url":"https://github.com/onaio/ansible-django","last_synced_at":"2025-04-28T15:06:28.074Z","repository":{"id":40268364,"uuid":"150433080","full_name":"onaio/ansible-django","owner":"onaio","description":"Use this role to install, configure, and manage Django","archived":false,"fork":false,"pushed_at":"2025-03-24T11:33:04.000Z","size":173,"stargazers_count":5,"open_issues_count":8,"forks_count":1,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-04-28T15:01:51.188Z","etag":null,"topics":["ansible","ansible-django","ansible-role","ansible-roles","django"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/onaio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2018-09-26T13:42:22.000Z","updated_at":"2023-12-14T10:35:18.000Z","dependencies_parsed_at":"2024-12-05T08:26:21.541Z","dependency_job_id":"923e124c-645e-4406-8b21-32efea34f944","html_url":"https://github.com/onaio/ansible-django","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onaio%2Fansible-django","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onaio%2Fansible-django/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onaio%2Fansible-django/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onaio%2Fansible-django/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onaio","download_url":"https://codeload.github.com/onaio/ansible-django/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251336389,"owners_count":21573188,"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-django","ansible-role","ansible-roles","django"],"created_at":"2025-01-09T17:19:28.684Z","updated_at":"2025-04-28T15:06:28.019Z","avatar_url":"https://github.com/onaio.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible-django #\n\n[![Build Status](https://github.com/onaio/ansible-django/workflows/CI/badge.svg)](https://github.com/onaio/ansible-django/actions?query=workflow%3ACI)\n\nUse this role to install, configure, and manage [Django](https://www.djangoproject.com/).\n\nThis is a very simple and purist role for django installation.  We only install and configure:\n\n- Django\n- Celery (optional)\n\nWe intentionally consider the installation and configuration of databases, web servers, and other things as out of scope for this role.  Therefore, naturally this role is to be used in a playbook that installs and configures those other things.\n\nBoth `Django` and `celery` are installed and set up as `systemd` services.\n\n## Role Variables ##\n\nSome of the more important variables are briefly described below.  You can see all variables by looking at the `defaults/main.yml` file.\n\n```yml\ndjango_system_user: \"django_app\"  # name of the user that will own the django installation\n\ndjango_python_apt_ppa: \"ppa:deadsnakes/ppa\" # The repository used to install python\ndjango_python_version: \"python3.8\"  # the python version to use with pip commands\ndjango_python_packages: # the python packages that would be required\n  - \"{{ django_python_version }}\"\n  - \"{{ django_python_version }}-dev\"\n  - python3-pip\n  - python3-distutils\n  - python3-setuptools\ndjango_pip_executable: \"pip3\" # Executable to use when running pip commands\n\ndjango_git_url: \"https://github.com/moshthepitt/django-template3.git\"  # the git repo of your django app which we are installing\n\ndjango_local_settings_path: \"path to /local_settings.py\"  # Path to the Django settings file\ndjango_settings_module: \"template3.settings\"  # Django settings module\ndjango_wsgi_module: \"template3.wsgi:application\"  # Django wsgi module\n```\n\nYou can look at `tests/test.yml` for examples of how to use these variables.\n\n### Django Settings ###\n\nYou can set any and all Django settings using the `django_settings` variable.\n\nHere is a fairly simple example:\n\n```yml\ndjango_settings:\n  BASE_DIR: \"os.path.dirname(os.path.dirname(__file__))\"\n  SITE_ID: 1\n  STATIC_ROOT: \"'/var/www/static'\"\n  STATIC_URL: \"'/static/'\"\n  MEDIA_ROOT: \"'/var/www/media'\"\n  MEDIA_URL: \"'/media/'\"\n  EMAIL_BACKEND: \"'django.core.mail.backends.console.EmailBackend'\"\n  EMAIL_HOST: \"'localhost'\"\n  EMAIL_PORT: \"1025\"\n  DEFAULT_FROM_EMAIL: \"'Hello World \u003chello@example.com\u003e'\"\n  ALLOWED_HOSTS: \"[]\"\n  DEBUG: True\n```\n\nAs you may have noticed the `django_settings` takes `key: value` arguments of the Django settings variables that we know and love.\n\nFor example, to set Debug=True, you would do:\n\n```yml\ndjango_settings:\n  DEBUG: True\n```\n\nTo set up your database, you'd do:\n\n```yml\ndjango_settings:\n  DATABASES: |\n    {\n      'default': {\n          'ENGINE': 'django.db.backends.postgresql',\n          'NAME': 'somedb',\n          'USER': 'someuser',\n          'PASSWORD': 'hunter2',\n          'HOST': '127.0.0.1',\n          'PORT': '5432',\n      }\n    }\n```\n\n## Testing ##\n\nThis project utilizes molecule for testing, the molecule tool can be installed by running `pip install 'molecule[docker]'` after which tests can run with `molecule test --all`\n\nThis project also comes with a Vagrantfile, which is a fast and easy alternative to test changes to the role, fire it up with `vagrant up`. _See [vagrant docs](https://docs.vagrantup.com/v2/) for getting setup with vagrant_\n\n## License ##\n\nApache 2\n\n## Authors ##\n\n[Ona Engineering](https://ona.io)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonaio%2Fansible-django","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonaio%2Fansible-django","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonaio%2Fansible-django/lists"}