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 Inline Diff

flashy/settings.py View file @ 732243d
""" 1
Django settings for flashy project. 2
3
Generated by 'django-admin startproject' using Django 1.8. 4
5
For more information on this file, see 6
https://docs.djangoproject.com/en/1.8/topics/settings/ 7
8
For the full list of settings and their values, see 9
https://docs.djangoproject.com/en/1.8/ref/settings/ 10
""" 11
12
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) 13 1 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os 14 2 import os
15 3
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 16 4 BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17 5
# SECURITY WARNING: don't run with debug turned on in production! 18 6 # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True 19 7 DEBUG = True
20 8
ALLOWED_HOSTS = [] 21 9 ALLOWED_HOSTS = []
22 10
AUTH_USER_MODEL = 'flashcards.User' 23 11 AUTH_USER_MODEL = 'flashcards.User'
# Application definition 24
25 12
INSTALLED_APPS = ( 26 13 INSTALLED_APPS = (
'simple_email_confirmation', 27 14 'simple_email_confirmation',
'flashcards', 28 15 'flashcards',
'django.contrib.admin', 29 16 'django.contrib.admin',
'django.contrib.admindocs', 30 17 'django.contrib.admindocs',
'django.contrib.auth', 31 18 'django.contrib.auth',
'django.contrib.contenttypes', 32 19 'django.contrib.contenttypes',
'django.contrib.sessions', 33 20 'django.contrib.sessions',
'django.contrib.messages', 34 21 'django.contrib.messages',
'django.contrib.staticfiles', 35 22 'django.contrib.staticfiles',
'django_ses', 36 23 'django_ses',
'rest_framework', 37 24 'rest_framework',
38 25
39 26
) 40 27 )
41 28
REST_FRAMEWORK = { 42 29 REST_FRAMEWORK = {
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.CursorPagination', 43 30 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.CursorPagination',
'PAGE_SIZE': 20 44 31 'PAGE_SIZE': 20
} 45 32 }
46 33
MIDDLEWARE_CLASSES = ( 47 34 MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware', 48 35 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 49 36 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 50 37 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 51 38 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 52 39 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 53 40 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 54 41 'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware', 55 42 'django.middleware.security.SecurityMiddleware',
) 56 43 )
57 44
ROOT_URLCONF = 'flashy.urls' 58 45 ROOT_URLCONF = 'flashy.urls'
# Authentication backends 59 46
AUTHENTICATION_BACKENDS = ( 60 47 AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend', 61 48 'django.contrib.auth.backends.ModelBackend',
) 62 49 )
63 50
TEMPLATES = [ 64 51 TEMPLATES = [
{ 65 52 {
'BACKEND': 'django.template.backends.django.DjangoTemplates', 66 53 'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': ['templates/'], 67 54 'DIRS': ['templates/'],
'APP_DIRS': True, 68 55 'APP_DIRS': True,
'OPTIONS': { 69 56 'OPTIONS': {
'context_processors': [ 70 57 'context_processors': [
'django.template.context_processors.debug', 71 58 'django.template.context_processors.debug',
'django.template.context_processors.request', 72 59 'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth', 73 60 'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages', 74 61 'django.contrib.messages.context_processors.messages',
], 75 62 ],
}, 76 63 },
}, 77 64 },
] 78 65 ]
79 66
WSGI_APPLICATION = 'flashy.wsgi.application' 80 67 WSGI_APPLICATION = 'flashy.wsgi.application'
81 68
82
# Database 83
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases 84
85
DATABASES = { 86 69 DATABASES = {
'default': { 87 70 'default': {
'ENGINE': 'django.db.backends.sqlite3', 88 71 'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 89 72 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
} 90 73 }
} 91 74 }
92 75
93
# Internationalization 94
# https://docs.djangoproject.com/en/1.8/topics/i18n/ 95
96
LANGUAGE_CODE = 'en-us' 97 76 LANGUAGE_CODE = 'en-us'
98 77 TIME_ZONE = 'America/Los_Angeles'
TIME_ZONE = 'UTC' 99
100