Cookiecutter-django: add example how to use mutiple domains in documentation

Created on 8 Feb 2019  路  3Comments  路  Source: pydanny/cookiecutter-django

Description

Add example in the documentation how to setup multiple domains for ALLOWED_HOSTS as environment variable. I tried many times to setup this right but couldn't figure out how to setup heroku environment for multiple domains.

Rationale

Faster setup for some users.

Use case(s) / visualization(s)

...

docs needs further review

Most helpful comment

After some thought, I believe it belongs in django-environ docs, not in ours. When using this project, one should be aware of the underlying dependencies and look at their documentation when needed. I don't think we should start documenting this kind of cases ourselves.

If you feel like the use of django-environ isn't clear enough, however, feel free to send a pull request to add this where you see fit.

All 3 comments

This is managed by django-environ in our setting, using the env.list() API:

https://github.com/pydanny/cookiecutter-django/blob/7fe87d9c97e9e3ad5d5efeaa239021d6754e4a6c/%7B%7Bcookiecutter.project_slug%7D%7D/config/settings/production.py#L13

The values it supports is not very well documented on their end, but looking at their test data as well as the code, values are comma-separated.

So the environment variable should look like this:

DJANGO_ALLOWED_HOSTS=domain.com,www.domain.com,api.domain.com

Maybe django-environ would accept a pull request to improve the relevant docstring?

Thanks you, now it works. It would be really nice if your example would be included in cookiecutter-djang documentation.

After some thought, I believe it belongs in django-environ docs, not in ours. When using this project, one should be aware of the underlying dependencies and look at their documentation when needed. I don't think we should start documenting this kind of cases ourselves.

If you feel like the use of django-environ isn't clear enough, however, feel free to send a pull request to add this where you see fit.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adammsteele picture adammsteele  路  3Comments

webyneter picture webyneter  路  3Comments

yunti picture yunti  路  4Comments

grll picture grll  路  3Comments

StupidTAO picture StupidTAO  路  3Comments