---

# Application settings.
virtualenv_path: "/webapps/{{ application_name }}"
project_path: "{{ virtualenv_path }}/{{ project_name }}"
application_log_dir: "{{ virtualenv_path }}/logs"
application_log_file: "{{ application_log_dir }}/gunicorn_supervisor.log"
requirements_file: "{{ project_path }}/requirements.txt"


# Gunicorn settings.
gunicorn_user: "{{ application_name }}"
gunicorn_group: webapps


# Nginx settings.
nginx_access_log_file: "{{ application_log_dir }}/nginx_access.log"
nginx_error_log_file: "{{ application_log_dir }}/nginx_error.log"
nginx_static_dir: "{{ virtualenv_path }}/static/"
nginx_media_dir: "{{ virtualenv_path }}/media/"


# Django environment variables.
django_environment:
  DJANGO_SETTINGS_MODULE: "{{ django_settings_file }}"
  DJANGO_SECRET_KEY: "{{ django_secret_key }}"
  MEDIA_ROOT: "{{ nginx_media_dir }}"
  STATIC_ROOT: "{{ nginx_static_dir }}"
  DATABASE_USER: "{{ db_user }}"
  DATABASE_PASSWORD: "{{ db_password }}"
  BROKER_URL: "{{ broker_url }}"

---

# Application settings.
virtualenv_path: "/webapps/{{ application_name }}"
project_path: "{{ virtualenv_path }}/{{ project_name }}"
application_log_dir: "{{ virtualenv_path }}/logs"
application_log_file: "{{ application_log_dir }}/gunicorn_supervisor.log"
requirements_file: "{{ project_path }}/requirements.txt"


# Gunicorn settings.
gunicorn_user: "{{ application_name }}"
gunicorn_group: webapps


# Nginx settings.
nginx_access_log_file: "{{ application_log_dir }}/nginx_access.log"
nginx_error_log_file: "{{ application_log_dir }}/nginx_error.log"
nginx_static_dir: "{{ virtualenv_path }}/static/"
nginx_media_dir: "{{ virtualenv_path }}/media/"


# Django environment variables.
django_environment:
  DJANGO_SETTINGS_MODULE: "{{ django_settings_file }}"
  DJANGO_SECRET_KEY: "{{ django_secret_key }}"
  MEDIA_ROOT: "{{ nginx_media_dir }}"
  STATIC_ROOT: "{{ nginx_static_dir }}"
  DATABASE_NAME: "{{ db_name }}"
  DATABASE_HOST: "{{ db_host|default(omit) }}"
  DATABASE_USER: "{{ db_user }}"
  DATABASE_PASSWORD: "{{ db_password }}"
  BROKER_URL: "{{ broker_url }}"

Add DATABASE_NAME and DATABASE_HOST env vars
Add DATABASE_NAME and DATABASE_HOST env vars

When using the db role, DATABASE_HOST will just be localhost, so we can
afford to omit it. The Django settings module is configured to default
to localhost when this env var is missing.
