* Auto-update pre-commit hooks
* Run 'pre-commit run -a'
* Fix pyupgrade into generated project
Co-authored-by: browniebroke <browniebroke@users.noreply.github.com>
Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
## Description
Replace Caddy with Traefik
## Rationale
There is some trouble with the Caddy license (https://github.com/pydanny/cookiecutter-django/pull/1282#issuecomment-329617536)
@drdaeman suggested using Traefik (https://github.com/pydanny/cookiecutter-django/pull/1282#issuecomment-353655273) which supports ACME and also plays very nice with Docker.
## Comments
I am currently using the proposed setup on a live site and it working great so far. If this PR is of interest to the maintainers, then I could commit more changes and take care of the documentation. Of course, any suggestions by the more experienced people around here, are welcome!
* Update generated project's .gitignore
* Post-gen gitignore .env/ and .env
* Fix linesep between gitignored entries
* Persist `.env/**/*` files into cookiecutter-django's VCS
* Rename .env/ to .envs/
* Reference the newly created .envs/**/.* files in local.yml
* Reference the newly created .envs/**/.* files in production.yml
* Delete .env.example
* Refactor post-gen-project.py
Closes#1299.
* Implement production-dotenv-files-to-dotenv-file merge script
* Create shared PyCharm Run Configuration for the automation script
* Randomize POSTGRES_PASSWORD in ./envs/(.local|.production)/.postgres
* Default POSTGRES_PASSWORD and POSTGRES_USER to random values
* Fix jinja linebreaks in local.yml
* Spaces in production.yml
* Fix post-merge leftovers & set DJANGO_ADMIN_URL automatically
* Prettify here and there
* Fix FileNotFoundError
* Leave a TODO in post_gen_hook.py
* Introduce keep_local_envs_in_vcs option
* Remove envs when not opted for
* Inline pre_gen_project.py if-condition
* Get rid of PROJECT_DIR_PATH in post_gen_project.py
* Clean up the docs
* Match copyright notices
* Document envs ins and outs