From 740483f0e70a2c3e4b340ce16f021f38f90b11bb Mon Sep 17 00:00:00 2001 From: Burhan Khalid Date: Tue, 7 Jul 2015 22:06:46 +0300 Subject: [PATCH] unifying environment variables --- {{cookiecutter.repo_name}}/README.rst | 12 ++++++------ .../config/settings/production.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/{{cookiecutter.repo_name}}/README.rst b/{{cookiecutter.repo_name}}/README.rst index 9f89972c..ef6155af 100644 --- a/{{cookiecutter.repo_name}}/README.rst +++ b/{{cookiecutter.repo_name}}/README.rst @@ -16,9 +16,6 @@ For configuration purposes, the following table maps the '{{cookiecutter.project ======================================= =========================== ============================================== ====================================================================== 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 memcached DJANGO_DATABASES DATABASES (default) See code See code DJANGO_DEBUG DEBUG True False @@ -32,7 +29,7 @@ DJANGO_SESSION_COOKIE_HTTPONLY SESSION_COOKIE_HTTPONLY n/a DJANGO_SESSION_COOKIE_SECURE SESSION_COOKIE_SECURE n/a False DJANGO_DEFAULT_FROM_EMAIL DEFAULT_FROM_EMAIL n/a "{{cookiecutter.project_name}} " DJANGO_SERVER_EMAIL SERVER_EMAIL n/a "{{cookiecutter.project_name}} " -EMAIL_SUBJECT_PREFIX EMAIL_SUBJECT_PREFIX n/a "[{{cookiecutter.project_name}}] " +DJANGO_EMAIL_SUBJECT_PREFIX EMAIL_SUBJECT_PREFIX n/a "[{{cookiecutter.project_name}}] " ======================================= =========================== ============================================== ====================================================================== The following table lists settings and their defaults for third-party applications: @@ -40,8 +37,11 @@ The following table lists settings and their defaults for third-party applicatio ======================================= =========================== ============================================== ====================================================================== Environment Variable Django Setting Development Default Production Default ======================================= =========================== ============================================== ====================================================================== -MAILGUN_API_KEY MAILGUN_ACCESS_KEY n/a raises error -MAILGUN_SERVER_NAME MAILGUN_SERVER_NAME n/a raises error +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 diff --git a/{{cookiecutter.repo_name}}/config/settings/production.py b/{{cookiecutter.repo_name}}/config/settings/production.py index acbb01de..1c103f3b 100644 --- a/{{cookiecutter.repo_name}}/config/settings/production.py +++ b/{{cookiecutter.repo_name}}/config/settings/production.py @@ -4,7 +4,7 @@ Production Configurations - Use djangosecure - 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 ''' from __future__ import absolute_import, unicode_literals @@ -103,9 +103,9 @@ INSTALLED_APPS = ('collectfast', ) + INSTALLED_APPS DEFAULT_FROM_EMAIL = env('DJANGO_DEFAULT_FROM_EMAIL', default='{{cookiecutter.project_name}} ') EMAIL_BACKEND = 'django_mailgun.MailgunBackend' -MAILGUN_ACCESS_KEY = env('MAILGUN_API_KEY') -MAILGUN_SERVER_NAME = env('MAILGUN_SERVER_NAME') -EMAIL_SUBJECT_PREFIX = env("EMAIL_SUBJECT_PREFIX", default='[{{cookiecutter.project_name}}] ') +MAILGUN_ACCESS_KEY = env('DJANGO_MAILGUN_API_KEY') +MAILGUN_SERVER_NAME = env('DJANGO_MAILGUN_SERVER_NAME') +EMAIL_SUBJECT_PREFIX = env("DJANGO_EMAIL_SUBJECT_PREFIX", default='[{{cookiecutter.project_name}}] ') SERVER_EMAIL = env('DJANGO_SERVER_EMAIL', DEFAULT_FROM_EMAIL) # TEMPLATE CONFIGURATION