diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 37a905b9d..b232b6e34 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,32 +1 @@ -**Note: for support questions, please use the `cookiecutter-django` tag on stackoverflow**. This repository's issues are reserved for feature requests and bug reports. - -* **I'm submitting a ... ** - - [ ] bug report - - [ ] feature request - - [ ] support request => Please do not submit support request here, see note at the top of this template. - - -* **Do you want to request a *feature* or report a *bug*?** - - - -* **What is the current behavior?** - - - -* **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem** - - -* **What is the expected behavior?** - - - -* **What is the motivation / use case for changing the behavior?** - - - -* **Please tell us about your environment:** - - - -* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc) +## [Make sure to follow one of the issue templates we've got](https://github.com/pydanny/cookiecutter-django/issues/new/choose), otherwise the issue might be closed immeditely diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md new file mode 100644 index 000000000..75f6a19c6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -0,0 +1,23 @@ +--- +name: Bug Report +about: Report a bug +--- + +## What happened? + + + + +## What should've happened instead? + + + + +## Steps to reproduce + +[//]: # (Any or all of the following:) +[//]: # (* Host system configuration: OS, Docker & friends' versions etc.) +[//]: # (* Project generation options) +[//]: # (* Logs) + + diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md new file mode 100644 index 000000000..b0d560d81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -0,0 +1,24 @@ +--- +name: New Feature Proposal +about: Propose a new feature +--- + +## Description + +[//]: # (What's it you're proposing? How should it be implemented?) + + + + +## Rationale + +[//]: # (Why should this feature be implemented?) + + + + +## Use case(s) / visualization(s) + +[//]: # ("Better to see something once than to hear about it a thousand times.") + + diff --git a/.github/ISSUE_TEMPLATE/improvement.md b/.github/ISSUE_TEMPLATE/improvement.md new file mode 100644 index 000000000..572652373 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/improvement.md @@ -0,0 +1,24 @@ +--- +name: Improvement Suggestion +about: Let us know how we could improve +--- + +## Description + +[//]: # (What's it you're proposing? How should it be implemented?) + + + + +## Rationale + +[//]: # (Why should this feature be implemented?) + + + + +## Use case(s) / visualization(s) + +[//]: # ("Better to see something once than to hear about it a thousand times.") + + diff --git a/.github/ISSUE_TEMPLATE/paid-support.md b/.github/ISSUE_TEMPLATE/paid-support.md new file mode 100644 index 000000000..7cd2c4a57 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/paid-support.md @@ -0,0 +1,10 @@ +--- +name: Paid Support Request +about: Ask Core Team members to help you out +--- + +Provided your question goes beyound [regular support](https://github.com/pydanny/cookiecutter-django/issues/new?template=question.md), and/or the task at hand is of timely/high priority nature use the below information to reach out for contributors directly. + +* Daniel Roy Greenfeld, Project Lead ([GitHub](https://github.com/pydanny), [Patreon](https://www.patreon.com/danielroygreenfeld)): expertise in Django and AWS ELB. + +* Nikita Shupeyko, Core Developer ([GitHub](https://github.com/webyneter)): expertise in Django, Docker, and Heroku. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 000000000..0c0f3d891 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,6 @@ +--- +name: Question +about: Please, ask your question on StackOverflow or Gitter +--- + +First, make sure to examine [the docs](https://cookiecutter-django.readthedocs.io/en/latest/). If that doesn't help post a question on [StackOverflow](https://stackoverflow.com/questions/tagged/cookiecutter-django) tagged with `cookiecutter-django`. Finally, feel free to join [Gitter](https://gitter.im/pydanny/cookiecutter-django) and ask around. diff --git a/.github/ISSUE_TEMPLATE/regression.md b/.github/ISSUE_TEMPLATE/regression.md new file mode 100644 index 000000000..80384004b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/regression.md @@ -0,0 +1,28 @@ +--- +name: Regression Report +about: Let us know if something that'd been working has broke +--- + +## What happened before? + + + + +## What happens now? + + + + +## Last stable commit / Since when? + + + + +## Steps to reproduce + +[//]: # (Any or all of the following:) +[//]: # (* Host system configuration: OS, Docker & friends' versions etc.) +[//]: # (* Project generation options) +[//]: # (* Logs) + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 000000000..8dbff6c25 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ +[//]: # (Thank you for helping us out: your efforts mean great deal to the project and the community as a whole!) + +[//]: # (Before you proceed:) + +[//]: # (1. Make sure to add yourself to `CONTRIBUTORS.rst` through this PR provided you're contributing here for the first time) +[//]: # (2. Don't forget to update the `docs/` presuming others would benefit from a concise description of whatever that you're proposing) + + +## Description + +[//]: # (What's it you're proposing?) + + + + +## Rationale + +[//]: # (Why does the project need that?) + + + + +## Use case(s) / visualization(s) + +[//]: # ("Better to see something once than to hear about it a thousand times.") + + diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index a5ea2d937..0f6761ed5 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -120,6 +120,7 @@ Listed in alphabetical order. Lyla Fischer Malik Sulaimanov `@flyudvik`_ @flyudvik Martin Blech + Martin Saizar `@msaizar`_ Mathijs Hoogland `@MathijsHoogland`_ Matt Braymer-Hayes `@mattayes`_ @mattayes Matt Linares @@ -218,6 +219,7 @@ Listed in alphabetical order. .. _@kevgathuku: https://github.com/kevgathuku .. _@knitatoms: https://github.com/knitatoms .. _@krzysztofzuraw: https://github.com/krzysztofzuraw +.. _@msaizar: https://github.com/msaizar .. _@MathijsHoogland: https://github.com/MathijsHoogland .. _@mattayes: https://github.com/mattayes .. _@menzenski: https://github.com/menzenski diff --git a/README.rst b/README.rst index fd8814eca..a39fe7863 100644 --- a/README.rst +++ b/README.rst @@ -280,6 +280,8 @@ experience better. Articles --------- +* `cookiecutter-django with Nginx, Route 53 and ELB`_ - Feb. 12, 2018 +* `cookiecutter-django and Amazon RDS`_ - Feb. 7, 2018 * `Deploying Cookiecutter-Django with Docker-Compose`_ - Oct. 19, 2017 * `Using Cookiecutter to Jumpstart a Django Project on Windows with PyCharm`_ - May 19, 2017 * `Exploring with Cookiecutter`_ - Dec. 3, 2016 @@ -291,6 +293,8 @@ Articles Have a blog or online publication? Write about your cookiecutter-django tips and tricks, then send us a pull request with the link. +.. _`cookiecutter-django with Nginx, Route 53 and ELB`: https://msaizar.com/blog/cookiecutter-django-nginx-route-53-and-elb/ +.. _`cookiecutter-django and Amazon RDS`: https://msaizar.com/blog/cookiecutter-django-and-amazon-rds/ .. _`Deploying Cookiecutter-Django with Docker-Compose`: http://adamantine.me/2017/10/19/deploying-cookiecutter-django-with-docker-compose/ .. _`Exploring with Cookiecutter`: http://www.snowboardingcoder.com/django/2016/12/03/exploring-with-cookiecutter/ .. _`Using Cookiecutter to Jumpstart a Django Project on Windows with PyCharm`: https://joshuahunter.com/posts/using-cookiecutter-to-jumpstart-a-django-project-on-windows-with-pycharm/ diff --git a/docs/deployment-on-heroku.rst b/docs/deployment-on-heroku.rst index 982168fc7..7006a2877 100644 --- a/docs/deployment-on-heroku.rst +++ b/docs/deployment-on-heroku.rst @@ -14,26 +14,31 @@ Run these commands to deploy the project to Heroku: heroku pg:promote DATABASE_URL heroku addons:create heroku-redis:hobby-dev - heroku addons:create mailgun - heroku config:set WEB_CONCURRENCY=4 - # Generating a 32 character-long random string without any of the visually similiar characters "IOl01": - heroku config:set DJANGO_ADMIN_URL="$(openssl rand -base64 4096 | tr -dc 'A-HJ-NP-Za-km-z2-9' | head -c 32)/" - heroku config:set DJANGO_SECRET_KEY="$(openssl rand -base64 64)" - heroku config:set DJANGO_SETTINGS_MODULE=config.settings.production - heroku config:set DJANGO_ALLOWED_HOSTS='.herokuapp.com' + # If using mailgun: + heroku addons:create mailgun:starter - heroku config:set DJANGO_AWS_ACCESS_KEY_ID=YOUR_AWS_ID_HERE - heroku config:set DJANGO_AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY_HERE - heroku config:set DJANGO_AWS_STORAGE_BUCKET_NAME=YOUR_AWS_S3_BUCKET_NAME_HERE - - # This is to be set only if you're using Sentry: - heroku config:set DJANGO_SENTRY_DSN=YOUR_SENTRY_DSN + heroku addons:create sentry:f1 heroku config:set PYTHONHASHSEED=random + heroku config:set WEB_CONCURRENCY=4 + heroku config:set DJANGO_DEBUG=False + heroku config:set DJANGO_SETTINGS_MODULE=config.settings.production + heroku config:set DJANGO_SECRET_KEY="$(openssl rand -base64 64)" + # Generating a 32 character-long random string without any of the visually similiar characters "IOl01": + heroku config:set DJANGO_ADMIN_URL="$(openssl rand -base64 4096 | tr -dc 'A-HJ-NP-Za-km-z2-9' | head -c 32)/" + heroku config:set DJANGO_ALLOWED_HOSTS= # Set this to your Heroku app url, e.g. 'bionic-beaver-28392.herokuapp.com' + + heroku config:set DJANGO_AWS_ACCESS_KEY_ID= # Assign with AWS_ACCESS_KEY_ID + heroku config:set DJANGO_AWS_SECRET_ACCESS_KEY= # Assign with AWS_SECRET_ACCESS_KEY + heroku config:set DJANGO_AWS_STORAGE_BUCKET_NAME= # Assign with AWS_STORAGE_BUCKET_NAME git push heroku master + heroku run python manage.py migrate - heroku run python manage.py check --deploy heroku run python manage.py createsuperuser + heroku run python manage.py collectstatic --no-input + + heroku run python manage.py check --deploy + heroku open diff --git a/docs/deployment-with-docker.rst b/docs/deployment-with-docker.rst index de0026a60..42798aae8 100644 --- a/docs/deployment-with-docker.rst +++ b/docs/deployment-with-docker.rst @@ -32,7 +32,7 @@ Configuring the Stack The majority of services above are configured through the use of environment variables. Just check out :ref:`envs` and you will know the drill. -To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``DJANGO_SENTRY_DSN`` variable. +To obtain logs and information about crashes in a production setup, make sure that you have access to an external Sentry instance (e.g. by creating an account with `sentry.io`_), and set the ``SENTRY_DSN`` variable. You will probably also need to setup the Mail backend, for example by adding a `Mailgun`_ API key and a `Mailgun`_ sender domain, otherwise, the account creation view will crash and result in a 500 error when the backend attempts to send an email to the account owner. diff --git a/docs/settings.rst b/docs/settings.rst index 60593a5d1..6e71a5151 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -44,7 +44,7 @@ Environment Variable Django Setting Development DJANGO_AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_ID n/a raises error DJANGO_AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY n/a raises error DJANGO_AWS_STORAGE_BUCKET_NAME AWS_STORAGE_BUCKET_NAME n/a raises error -DJANGO_SENTRY_DSN SENTRY_DSN n/a raises error +SENTRY_DSN SENTRY_DSN n/a raises error DJANGO_SENTRY_CLIENT SENTRY_CLIENT n/a raven.contrib.django.raven_compat.DjangoClient DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a logging.INFO MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error diff --git a/requirements.txt b/requirements.txt index eedbfad06..b428b6cb0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,5 +9,5 @@ flake8==3.5.0 # Testing # ------------------------------------------------------------------------------ tox==3.0.0 -pytest==3.5.1 +pytest==3.6.0 pytest-cookies==0.3.0 diff --git a/{{cookiecutter.project_slug}}/.envs/.production/.django b/{{cookiecutter.project_slug}}/.envs/.production/.django index 2e9eefea7..5cb90897b 100644 --- a/{{cookiecutter.project_slug}}/.envs/.production/.django +++ b/{{cookiecutter.project_slug}}/.envs/.production/.django @@ -37,7 +37,7 @@ WEB_CONCURRENCY=4 {% if cookiecutter.use_sentry == 'y' %} # Sentry # ------------------------------------------------------------------------------ -DJANGO_SENTRY_DSN= +SENTRY_DSN= {% endif %} # Redis diff --git a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile index b56710b14..f64f3fa07 100644 --- a/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/local/django/Dockerfile @@ -9,7 +9,7 @@ RUN apk update \ # Pillow dependencies && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \ # CFFI dependencies - && apk add libffi-dev openssl-dev py-cffi \ + && apk add libffi-dev py-cffi \ # Translations dependencies && apk add gettext \ # https://docs.djangoproject.com/en/dev/ref/django-admin/#dbshell diff --git a/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile index 8cbbf1df7..c32efb3ee 100644 --- a/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/caddy/Dockerfile @@ -1,3 +1,3 @@ -FROM abiosoft/caddy:0.11 +FROM abiosoft/caddy:0.11.0 COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile diff --git a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile index 04ac0d55e..b204a4810 100644 --- a/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/production/django/Dockerfile @@ -9,7 +9,7 @@ RUN apk update \ # Pillow dependencies && apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \ # CFFI dependencies - && apk add libffi-dev openssl-dev py-cffi + && apk add libffi-dev py-cffi RUN addgroup -S django \ && adduser -S -G django django @@ -19,23 +19,25 @@ COPY ./requirements /requirements RUN pip install --no-cache-dir -r /requirements/production.txt \ && rm -rf /requirements -COPY ./compose/production/django/gunicorn /gunicorn -RUN sed -i 's/\r//' /gunicorn -RUN chmod +x /gunicorn -RUN chown django /gunicorn - COPY ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r//' /entrypoint RUN chmod +x /entrypoint RUN chown django /entrypoint + +COPY ./compose/production/django/start /start +RUN sed -i 's/\r//' /start +RUN chmod +x /start +RUN chown django /start {% if cookiecutter.use_celery == "y" %} COPY ./compose/production/django/celery/worker/start /start-celeryworker RUN sed -i 's/\r//' /start-celeryworker RUN chmod +x /start-celeryworker +RUN chown django /start-celeryworker COPY ./compose/production/django/celery/beat/start /start-celerybeat RUN sed -i 's/\r//' /start-celerybeat RUN chmod +x /start-celerybeat +RUN chown django /start-celerybeat {% endif %} COPY . /app diff --git a/{{cookiecutter.project_slug}}/compose/production/django/gunicorn b/{{cookiecutter.project_slug}}/compose/production/django/start similarity index 100% rename from {{cookiecutter.project_slug}}/compose/production/django/gunicorn rename to {{cookiecutter.project_slug}}/compose/production/django/start diff --git a/{{cookiecutter.project_slug}}/config/settings/production.py b/{{cookiecutter.project_slug}}/config/settings/production.py index 889ae179a..ecd517ddd 100644 --- a/{{cookiecutter.project_slug}}/config/settings/production.py +++ b/{{cookiecutter.project_slug}}/config/settings/production.py @@ -187,7 +187,7 @@ MIDDLEWARE = ['raven.contrib.django.raven_compat.middleware.SentryResponseErrorI # Sentry # ------------------------------------------------------------------------------ -SENTRY_DSN = env('DJANGO_SENTRY_DSN') +SENTRY_DSN = env('SENTRY_DSN') SENTRY_CLIENT = env('DJANGO_SENTRY_CLIENT', default='raven.contrib.django.raven_compat.DjangoClient') LOGGING = { 'version': 1, diff --git a/{{cookiecutter.project_slug}}/production.yml b/{{cookiecutter.project_slug}}/production.yml index 51c896275..c76197513 100644 --- a/{{cookiecutter.project_slug}}/production.yml +++ b/{{cookiecutter.project_slug}}/production.yml @@ -17,7 +17,7 @@ services: env_file: - ./.envs/.production/.django - ./.envs/.production/.postgres - command: /gunicorn + command: /start postgres: build: diff --git a/{{cookiecutter.project_slug}}/requirements/local.txt b/{{cookiecutter.project_slug}}/requirements/local.txt index 7740f9897..a838ee263 100644 --- a/{{cookiecutter.project_slug}}/requirements/local.txt +++ b/{{cookiecutter.project_slug}}/requirements/local.txt @@ -14,7 +14,7 @@ flower==0.9.2 # https://github.com/mher/flower # Testing # ------------------------------------------------------------------------------ -pytest==3.5.1 # https://github.com/pytest-dev/pytest +pytest==3.6.0 # https://github.com/pytest-dev/pytest pytest-sugar==0.9.1 # https://github.com/Frozenball/pytest-sugar # Code quality diff --git a/{{cookiecutter.project_slug}}/requirements/production.txt b/{{cookiecutter.project_slug}}/requirements/production.txt index e36dc78a2..9ddb7d15f 100644 --- a/{{cookiecutter.project_slug}}/requirements/production.txt +++ b/{{cookiecutter.project_slug}}/requirements/production.txt @@ -14,4 +14,4 @@ raven==6.8.0 # https://github.com/getsentry/raven-python # Django # ------------------------------------------------------------------------------ django-storages[boto3]==1.6.6 # https://github.com/jschneier/django-storages -django-anymail==2.2 # https://github.com/anymail/django-anymail +django-anymail[mailgun]==2.2 # https://github.com/anymail/django-anymail