mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-09 14:34:53 +03:00
Documentation update
This commit is contained in:
parent
c0351a4bb7
commit
f3258f5453
|
@ -48,7 +48,7 @@ Features
|
|||
* Optional custom static build using Gulp and livereload
|
||||
* Send emails via Anymail_ (using Mailgun_ by default, but switchable)
|
||||
* Media storage using Amazon S3
|
||||
* Docker support using docker-compose_ for development and production (using Caddy_ with LetsEncrypt_ support)
|
||||
* Docker support using docker-compose_ for development and production (using Traefik_ with LetsEncrypt_ support)
|
||||
* Procfile_ for deploying to Heroku
|
||||
* Instructions for deploying to PythonAnywhere_
|
||||
* Run tests with unittest or py.test
|
||||
|
@ -82,7 +82,7 @@ Optional Integrations
|
|||
.. _Sentry: https://sentry.io/welcome/
|
||||
.. _docker-compose: https://github.com/docker/compose
|
||||
.. _PythonAnywhere: https://www.pythonanywhere.com/
|
||||
.. _Caddy: https://caddyserver.com/
|
||||
.. _Traefik: https://traefik.io/
|
||||
.. _LetsEncrypt: https://letsencrypt.org/
|
||||
|
||||
Constraints
|
||||
|
|
|
@ -19,7 +19,7 @@ Before you begin, check out the ``production.yml`` file in the root of this proj
|
|||
* ``django``: your application running behind ``Gunicorn``;
|
||||
* ``postgres``: PostgreSQL database with the application's relational data;
|
||||
* ``redis``: Redis instance for caching;
|
||||
* ``caddy``: Caddy web server with HTTPS on by default.
|
||||
* ``traefik``: Traefik reverse proxy with HTTPS on by default.
|
||||
|
||||
Provided you have opted for Celery (via setting ``use_celery`` to ``y``) there are three more services:
|
||||
|
||||
|
@ -63,11 +63,11 @@ It is always better to deploy a site behind HTTPS and will become crucial as the
|
|||
|
||||
* Access to the Django admin is set up by default to require HTTPS in production or once *live*.
|
||||
|
||||
The Caddy web server used in the default configuration will get you a valid certificate from Lets Encrypt and update it automatically. All you need to do to enable this is to make sure that your DNS records are pointing to the server Caddy runs on.
|
||||
The Traefik reverse proxy used in the default configuration will get you a valid certificate from Lets Encrypt and update it automatically. All you need to do to enable this is to make sure that your DNS records are pointing to the server Traefik runs on.
|
||||
|
||||
You can read more about this here at `Automatic HTTPS`_ in the Caddy docs.
|
||||
You can read more about this feature and how to configure it, at `Automatic HTTPS`_ in the Traefik docs.
|
||||
|
||||
.. _Automatic HTTPS: https://caddyserver.com/docs/automatic-https
|
||||
.. _Automatic HTTPS: https://docs.traefik.io/configuration/acme/
|
||||
|
||||
|
||||
(Optional) Postgres Data Volume Modifications
|
||||
|
@ -112,7 +112,7 @@ If you want to scale your application, run::
|
|||
docker-compose -f production.yml scale django=4
|
||||
docker-compose -f production.yml scale celeryworker=2
|
||||
|
||||
.. warning:: don't try to scale ``postgres``, ``celerybeat``, or ``caddy``.
|
||||
.. warning:: don't try to scale ``postgres``, ``celerybeat``, or ``traefik``.
|
||||
|
||||
To see how your containers are doing run::
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ The most important thing for us here now is ``env_file`` section enlisting ``./.
|
|||
│ ├── .django
|
||||
│ └── .postgres
|
||||
└── .production
|
||||
├── .caddy
|
||||
├── .traefik
|
||||
├── .django
|
||||
└── .postgres
|
||||
|
||||
|
@ -120,7 +120,7 @@ Consider the aforementioned ``.envs/.local/.postgres``: ::
|
|||
POSTGRES_USER=XgOWtQtJecsAbaIyslwGvFvPawftNaqO
|
||||
POSTGRES_PASSWORD=jSljDz4whHuwO3aJIgVBrqEml5Ycbghorep4uVJ4xjDYQu0LfuTZdctj7y0YcCLu
|
||||
|
||||
The three envs we are presented with here are ``POSTGRES_DB``, ``POSTGRES_USER``, and ``POSTGRES_PASSWORD`` (by the way, their values have also been generated for you). You might have figured out already where these definitions will end up; it's all the same with ``django`` and ``caddy`` service container envs.
|
||||
The three envs we are presented with here are ``POSTGRES_DB``, ``POSTGRES_USER``, and ``POSTGRES_PASSWORD`` (by the way, their values have also been generated for you). You might have figured out already where these definitions will end up; it's all the same with ``django`` and ```` service container envs.
|
||||
|
||||
One final touch: should you ever need to merge ``.envs/production/*`` in a single ``.env`` run the ``merge_production_dotenvs_in_dotenv.py``: ::
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ PRODUCTION_DOTENVS_DIR_PATH = os.path.join(ROOT_DIR_PATH, ".envs", ".production"
|
|||
PRODUCTION_DOTENV_FILE_PATHS = [
|
||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, ".django"),
|
||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, ".postgres"),
|
||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, ".caddy"),
|
||||
os.path.join(PRODUCTION_DOTENVS_DIR_PATH, ".traefik"),
|
||||
]
|
||||
DOTENV_FILE_PATH = os.path.join(ROOT_DIR_PATH, ".env")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user