The Django Polls Application¶
We’ll use the result of running through Django’s “Writing your first Django app” tutorial as the starting point for this tutorial. The Django tutorial can be found at https://docs.djangoproject.com/en/2.1/intro/tutorial01/
Security Disclaimer¶
Please note that we will not be listing all of the steps required to secure the application for a production environment. See: https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
Repository Implementing Polls Application¶
We’ll use the following repository to illustrate how to run the “Polls” application in a Docker container: https://github.com/jameswettenhall/django-polls-tutorial
Each step of the tutorial will use a different branch of the repository:
Polls Application Without Docker¶
Firstly, we’ll run the Polls application without Docker, using the master
branch:
https://github.com/jameswettenhall/django-polls-tutorial/blob/master/README.md
Adding a RESTful API¶
Then we’ll add a RESTful API to the Polls application (still without Docker),
using the api
branch:
https://github.com/jameswettenhall/django-polls-tutorial/blob/api/README.md
Serializing Settings With YAML¶
Then we’ll discuss how to serialize the application’s settings in YAML and make
them available to the containerized application, using the yaml
branch:
https://github.com/jameswettenhall/django-polls-tutorial/blob/yaml/README.md
Docker Implementation of Polls Application¶
Then we’ll discuss how to run the application in a Docker container, with a
MySQL database server provided by another Docker container, using the docker
branch:
https://github.com/jameswettenhall/django-polls-tutorial/blob/docker/README.md