practical-ansible.nginx-django
Variables
Project Archive
This role requires you to package your Django application into an archive. It's best to use setuptools since it's commonly used, but a simple zip file will also work. Set django_archive
to the location of your archive.
Project Environment
django_project_environment
allows you to deploy different environments on the same server, which is useful for saving costs. It defaults to "staging".
Project Name
Set django_project_name
to your project's name. By default, it checks the environment variable DJANGO_PROJECT_NAME
.
Project Version
Set django_project_version
to your project's version. It defaults to "develop". Deploying the same version twice will replace what’s currently on the server. Old versions are kept on the server, so you can easily revert by changing the symlink.
Server Name
Set django_server_name
to your project's domain name. You can specify multiple names separated by a space. It defaults to checking the environment variable DJANGO_SERVER_NAME
.
Directory for Django Projects
Set django_projects_directory
to the path where you typically keep your Django projects. It defaults to "/var/www".
Static Files Directory
Set django_static_dir
to the directory where you store static files. By default, this is left empty. We recommend using a CDN, such as AWS S3, for storing static files. It looks for the environment variable DJANGO_STATIC_DIR
by default.
Django Configuration Module
Set django_config
to the module path of your Django configuration, like 'app.settings'.
Extra Django Configuration Template
Set django_config_file
to the path of the external configuration template for your Django application.
Django WSGI File
Set django_file_file
to the path of the WSGI file for your Django application.
Deploy your Django project to Nginx with minimal config
ansible-galaxy install practical-ansible.nginx-django