merging from upstream

This commit is contained in:
Burhan Khalid 2015-07-08 12:58:19 +03:00
commit 32dd1be245
6 changed files with 33 additions and 28 deletions

View File

@ -47,6 +47,7 @@ Harry Percival / @hjwp
Cullen Rhodes / @c-rhodes Cullen Rhodes / @c-rhodes
Burhan Khalid / @burhan Burhan Khalid / @burhan
Audrey Roy Greenfeld / @audreyr (and creator/maintainer of cookiecutter) * Audrey Roy Greenfeld / @audreyr (and creator/maintainer of cookiecutter) *
Burhan Khalid / @burhan
* Possesses commit rights * Possesses commit rights

View File

@ -24,7 +24,7 @@ Features
* Registration via django-allauth_ * Registration via django-allauth_
* Procfile_ for deploying to Heroku * Procfile_ for deploying to Heroku
* Grunt build for compass and livereload * Grunt build for compass and livereload
* Basic e-mail configurations for send emails via SendGrid_ * Basic e-mail configurations for send emails via Mailgun_
* Media storage using Amazon S3 * Media storage using Amazon S3
* Serve static files from Amazon S3 or Whitenoise_ (optional) * Serve static files from Amazon S3 or Whitenoise_ (optional)
@ -35,7 +35,7 @@ Features
.. _django-allauth: https://github.com/pennersr/django-allauth .. _django-allauth: https://github.com/pennersr/django-allauth
.. _django-avatar: https://github.com/jezdez/django-avatar/ .. _django-avatar: https://github.com/jezdez/django-avatar/
.. _Procfile: https://devcenter.heroku.com/articles/procfile .. _Procfile: https://devcenter.heroku.com/articles/procfile
.. _SendGrid: https://sendgrid.com/ .. _Mailgun: https://mailgun.com/
.. _Whitenoise: https://whitenoise.readthedocs.org/ .. _Whitenoise: https://whitenoise.readthedocs.org/

View File

@ -16,9 +16,6 @@ For configuration purposes, the following table maps the '{{cookiecutter.project
======================================= =========================== ============================================== ====================================================================== ======================================= =========================== ============================================== ======================================================================
Environment Variable Django Setting Development Default Production Default Environment Variable Django Setting Development Default Production Default
======================================= =========================== ============================================== ====================================================================== ======================================= =========================== ============================================== ======================================================================
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_CACHES CACHES (default) locmem redis DJANGO_CACHES CACHES (default) locmem redis
DJANGO_DATABASES DATABASES (default) See code See code DJANGO_DATABASES DATABASES (default) See code See code
DJANGO_DEBUG DEBUG True False DJANGO_DEBUG DEBUG True False
@ -30,16 +27,22 @@ DJANGO_SECURE_FRAME_DENY SECURE_FRAME_DENY n/a
DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS HSTS_INCLUDE_SUBDOMAINS n/a True DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS HSTS_INCLUDE_SUBDOMAINS n/a True
DJANGO_SESSION_COOKIE_HTTPONLY SESSION_COOKIE_HTTPONLY n/a True DJANGO_SESSION_COOKIE_HTTPONLY SESSION_COOKIE_HTTPONLY n/a True
DJANGO_SESSION_COOKIE_SECURE SESSION_COOKIE_SECURE n/a False DJANGO_SESSION_COOKIE_SECURE SESSION_COOKIE_SECURE n/a False
DJANGO_EMAIL_BACKEND EMAIL_BACKEND django.core.mail.backends.console.EmailBackend django.core.mail.backends.smtp.EmailBackend
DJANGO_EMAIL_HOST EMAIL_HOST localhost smtp.sendgrid.com
EMAIL_PORT EMAIL_PORT 1025 587
SENDGRID_USERNAME EMAIL_HOST_USER n/a raises error
SENDGRID_PASSWORD EMAIL_HOST_PASSWORD n/a raises error
DJANGO_DEFAULT_FROM_EMAIL DEFAULT_FROM_EMAIL n/a "{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>" DJANGO_DEFAULT_FROM_EMAIL DEFAULT_FROM_EMAIL n/a "{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>"
EMAIL_SUBJECT_PREFIX EMAIL_SUBJECT_PREFIX n/a "[{{cookiecutter.project_name}}] " DJANGO_SERVER_EMAIL SERVER_EMAIL n/a "{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>"
DJANGO_EMAIL_SUBJECT_PREFIX EMAIL_SUBJECT_PREFIX n/a "[{{cookiecutter.project_name}}] "
======================================= =========================== ============================================== ====================================================================== ======================================= =========================== ============================================== ======================================================================
* TODO: Add vendor-added settings in another table The following table lists settings and their defaults for third-party applications:
======================================= =========================== ============================================== ======================================================================
Environment Variable Django Setting Development Default Production Default
======================================= =========================== ============================================== ======================================================================
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_MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error
DJANGO_MAILGUN_SERVER_NAME MAILGUN_SERVER_NAME n/a raises error
======================================= =========================== ============================================== ======================================================================
Getting up and running Getting up and running
---------------------- ----------------------
@ -126,8 +129,8 @@ Run these commands to deploy the project to Heroku:
heroku pg:backups schedule DATABASE_URL heroku pg:backups schedule DATABASE_URL
heroku pg:promote DATABASE_URL heroku pg:promote DATABASE_URL
heroku addons:create sendgrid:starter
heroku addons:create heroku-redis:hobby-dev heroku addons:create heroku-redis:hobby-dev
heroku addons:create mailgun
heroku config:set DJANGO_SECRET_KEY=RANDOM_SECRET_KEY_HERE heroku config:set DJANGO_SECRET_KEY=RANDOM_SECRET_KEY_HERE
heroku config:set DJANGO_SETTINGS_MODULE='config.settings.production' heroku config:set DJANGO_SETTINGS_MODULE='config.settings.production'
@ -136,8 +139,7 @@ Run these commands to deploy the project to Heroku:
heroku config:set DJANGO_AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY_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 heroku config:set DJANGO_AWS_STORAGE_BUCKET_NAME=YOUR_AWS_S3_BUCKET_NAME_HERE
heroku config:set SENDGRID_USERNAME=YOUR_SENDGRID_USERNAME heroku config:set DJANGO_MAILGUN_SERVER_NAME=YOUR_MALGUN_SERVER
heroku config:set SENDGRID_PASSWORD=YOUR_SENDGRID_PASSWORD
git push heroku master git push heroku master
heroku run python manage.py migrate heroku run python manage.py migrate
@ -180,8 +182,8 @@ You can then deploy by running the following commands.
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_ACCESS_KEY_ID=YOUR_AWS_ID_HERE ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_ACCESS_KEY_ID=YOUR_AWS_ID_HERE
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY_HERE ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY_HERE
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_STORAGE_BUCKET_NAME=YOUR_AWS_S3_BUCKET_NAME_HERE ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_STORAGE_BUCKET_NAME=YOUR_AWS_S3_BUCKET_NAME_HERE
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} SENDGRID_USERNAME=YOUR_SENDGRID_USERNAME ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} SENDGRID_PASSWORD=YOUR_SENDGRID_PASSWORD ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_MAILGUN_SERVER_NAME=YOUR_MAILGUN_SERVER
ssh -t dokku@yourservername.com dokku run {{cookiecutter.repo_name}} python manage.py migrate ssh -t dokku@yourservername.com dokku run {{cookiecutter.repo_name}} python manage.py migrate
ssh -t dokku@yourservername.com dokku run {{cookiecutter.repo_name}} python manage.py createsuperuser ssh -t dokku@yourservername.com dokku run {{cookiecutter.repo_name}} python manage.py createsuperuser

View File

@ -4,7 +4,7 @@ Production Configurations
- Use djangosecure - Use djangosecure
- Use Amazon's S3 for storing static files and uploaded media - Use Amazon's S3 for storing static files and uploaded media
- Use sendgrid to send emails - Use mailgun to send emails
- Use MEMCACHIER on Heroku - Use MEMCACHIER on Heroku
''' '''
from __future__ import absolute_import, unicode_literals from __future__ import absolute_import, unicode_literals
@ -102,13 +102,11 @@ INSTALLED_APPS = ('collectfast', ) + INSTALLED_APPS
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL', DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL',
default='{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>') default='{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>')
EMAIL_HOST = env("DJANGO_EMAIL_HOST", default='smtp.sendgrid.com') EMAIL_BACKEND = 'django_mailgun.MailgunBackend'
EMAIL_HOST_PASSWORD = env("SENDGRID_PASSWORD") MAILGUN_ACCESS_KEY = env('DJANGO_MAILGUN_API_KEY')
EMAIL_HOST_USER = env('SENDGRID_USERNAME') MAILGUN_SERVER_NAME = env('DJANGO_MAILGUN_SERVER_NAME')
EMAIL_PORT = env.int("EMAIL_PORT", default=587) EMAIL_SUBJECT_PREFIX = env("DJANGO_EMAIL_SUBJECT_PREFIX", default='[{{cookiecutter.project_name}}] ')
EMAIL_SUBJECT_PREFIX = env("EMAIL_SUBJECT_PREFIX", default='[{{cookiecutter.project_name}}] ') SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', DEFAULT_FROM_EMAIL)
EMAIL_USE_TLS = True
SERVER_EMAIL = EMAIL_HOST_USER
# TEMPLATE CONFIGURATION # TEMPLATE CONFIGURATION
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------

View File

@ -5,7 +5,7 @@ django==1.8.2
django-environ==0.3.0 django-environ==0.3.0
django-secure==1.0.1 django-secure==1.0.1
{% if cookiecutter.use_whitenoise == 'y' -%} {% if cookiecutter.use_whitenoise == 'y' -%}
whitenoise==2.0 whitenoise==2.0.2
{%- endif %} {%- endif %}
@ -18,11 +18,11 @@ django-floppyforms==1.4.1
django-model-utils==2.2 django-model-utils==2.2
# Images # Images
Pillow==2.8.2 Pillow==2.9.0
# For user registration, either via email or social # For user registration, either via email or social
# Well-built with regular release cycles! # Well-built with regular release cycles!
django-allauth==0.20.0 django-allauth==0.21.0
# For the persistence stores # For the persistence stores
psycopg2==2.6.1 psycopg2==2.6.1

View File

@ -14,3 +14,7 @@ django-storages-redux==1.2.3
{% if cookiecutter.use_whitenoise != 'y' -%} {% if cookiecutter.use_whitenoise != 'y' -%}
Collectfast==0.2.3 Collectfast==0.2.3
{%- endif %} {%- endif %}
# Mailgun Support
# ---------------
django-mailgun==0.2.2