Changeset - bb9ac9fd67cf
[Not reviewed]
0 1 0
Christopher Neugebauer - 7 years ago 2017-08-17 16:27:00
chrisjrn@gmail.com
Adds a default e-mail setting
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
pinaxcon/settings.py
Show inline comments
...
 
@@ -3,48 +3,53 @@ import dj_database_url
 

	
 

	
 
PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
 
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
 
BASE_DIR = PACKAGE_ROOT
 

	
 
DEBUG = bool(int(os.environ.get("DEBUG", "1")))
 

	
 
DATABASES = {
 
    "default": {
 
        "ENGINE": "django.db.backends.sqlite3",
 
        "NAME": os.path.join(PROJECT_ROOT, "dev.db"),
 
    }
 
}
 

	
 
UNPREPEND_WWW = bool(os.environ.get("DJANGO_UNPREPEND_WWW", False))
 

	
 
# HEROKU: Update database configuration with $DATABASE_URL.
 
import dj_database_url
 
db_from_env = dj_database_url.config()
 
DATABASES['default'].update(db_from_env)
 

	
 
ALLOWED_HOSTS = [".localhost", ".herokuapp.com", ".northbaypython.org"]
 

	
 
# If DEFAULT_FROM_EMAIL is not set, email will most likely break in prod.
 
from_email = os.environ.get("DJANGO_DEFAULT_FROM_EMAIL", None)
 
if from_email is not None:
 
    DEFAULT_FROM_EMAIL = from_email
 

	
 
# Local time zone for this installation. Choices can be found here:
 
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
 
# although not all choices may be available on all operating systems.
 
# On Unix systems, a value of None will cause Django to use the same
 
# timezone as the operating system.
 
# If running in a Windows environment this must be set to the same as your
 
# system time zone.
 
TIME_ZONE = os.environ.get("TZ", "America/Los_Angeles")
 

	
 

	
 
# Set the email address that will receive errors.
 
admin_email = os.environ.get("DJANGO_ADMIN_EMAIL", None)
 
if admin_email is not None:
 
    ADMINS = ("Webmaster", admin_email)
 

	
 

	
 
# Use SSLRedirectMiddleware
 
SSL_ON = os.environ.get("DJANGO_SSL_ON", True)
 
SSL_ALWAYS = os.environ.get("DJANGO_SSL_ALWAYS", False)
 

	
 
# Language code for this installation. All choices can be found here:
 
# http://www.i18nguy.com/unicode/language-identifiers.html
 
LANGUAGE_CODE = "en-us"
 

	
0 comments (0 inline, 0 general)