Commit 732243dd6ea05716ff83442648c4b35d1d1e57ed

Authored by Andrew Buss
1 parent ce5052fea2
Exists in master

SES only used if access key id is in environemtn

Showing 1 changed file with 9 additions and 34 deletions Side-by-side Diff

flashy/settings.py View file @ 732243d
1   -"""
2   -Django settings for flashy project.
3   -
4   -Generated by 'django-admin startproject' using Django 1.8.
5   -
6   -For more information on this file, see
7   -https://docs.djangoproject.com/en/1.8/topics/settings/
8   -
9   -For the full list of settings and their values, see
10   -https://docs.djangoproject.com/en/1.8/ref/settings/
11   -"""
12   -
13 1 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
14 2 import os
15 3  
... ... @@ -21,7 +9,6 @@
21 9 ALLOWED_HOSTS = []
22 10  
23 11 AUTH_USER_MODEL = 'flashcards.User'
24   -# Application definition
25 12  
26 13 INSTALLED_APPS = (
27 14 'simple_email_confirmation',
... ... @@ -56,7 +43,7 @@
56 43 )
57 44  
58 45 ROOT_URLCONF = 'flashy.urls'
59   -# Authentication backends
  46 +
60 47 AUTHENTICATION_BACKENDS = (
61 48 'django.contrib.auth.backends.ModelBackend',
62 49 )
... ... @@ -79,10 +66,6 @@
79 66  
80 67 WSGI_APPLICATION = 'flashy.wsgi.application'
81 68  
82   -
83   -# Database
84   -# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
85   -
86 69 DATABASES = {
87 70 'default': {
88 71 'ENGINE': 'django.db.backends.sqlite3',
89 72  
90 73  
91 74  
92 75  
93 76  
94 77  
... ... @@ -90,34 +73,26 @@
90 73 }
91 74 }
92 75  
93   -
94   -# Internationalization
95   -# https://docs.djangoproject.com/en/1.8/topics/i18n/
96   -
97 76 LANGUAGE_CODE = 'en-us'
98   -
99   -TIME_ZONE = 'UTC'
100   -
  77 +TIME_ZONE = 'America/Los_Angeles'
101 78 USE_I18N = True
102   -
103 79 USE_L10N = True
104   -
105 80 USE_TZ = True
106 81  
107   -
108   -# Static files (CSS, JavaScript, Images)
109   -# https://docs.djangoproject.com/en/1.8/howto/static-files/
110   -
111 82 STATIC_URL = '/static/'
112 83 STATIC_ROOT = 'static'
113 84  
114   -EMAIL_BACKEND = 'django_ses.SESBackend'
  85 +# Four settings just to be sure
115 86 EMAIL_FROM = 'noreply@flashy.cards'
116 87 EMAIL_HOST_USER = 'noreply@flashy.cards'
117 88 DEFAULT_FROM_EMAIL = 'noreply@flashy.cards'
118 89 SERVER_EMAIL = 'noreply@flashy.cards'
119 90  
120   -AWS_SES_REGION_NAME = 'us-west-2'
121   -AWS_SES_REGION_ENDPOINT = 'email.us-west-2.amazonaws.com'
  91 +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
  92 +if 'AWS_ACCESS_KEY_ID' in os.environ:
  93 + AWS_SES_REGION_NAME = 'us-west-2'
  94 + AWS_SES_REGION_ENDPOINT = 'email.us-west-2.amazonaws.com'
  95 + EMAIL_BACKEND = 'django_ses.SESBackend'
  96 +
122 97 SECRET_KEY = os.environ.get('SECRET_KEY', 'LOL DEFAULT SECRET KEY')