|
12 | 12 | import os
|
13 | 13 | import dj_database_url
|
14 | 14 |
|
| 15 | + |
| 16 | +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
15 | 17 | BASE_DIR = os.path.dirname(os.path.dirname(__file__))
|
16 | 18 |
|
17 | 19 |
|
18 | 20 | # Quick-start development settings - unsuitable for production
|
19 |
| -# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ |
| 21 | +# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ |
20 | 22 |
|
21 | 23 | # SECURITY WARNING: keep the secret key used in production secret!
|
22 |
| -DEFAULT_SECRET_KEY = '3iy-!-d$!pc_ll$#$elg&cpr@*tfn-d5&n9ag=)%#()t$$5%5^' |
23 |
| -SECRET_KEY = os.environ.get('SECRET_KEY', DEFAULT_SECRET_KEY) |
| 24 | +SECRET_KEY = 'i+acxn5(akgsn!sr4^qgf(^m&*@+g1@u^t@=8s@axc41ml*f=s' |
24 | 25 |
|
25 | 26 | # SECURITY WARNING: don't run with debug turned on in production!
|
26 | 27 | DEBUG = True
|
27 | 28 |
|
28 | 29 | TEMPLATE_DEBUG = True
|
29 | 30 |
|
30 |
| -ALLOWED_HOSTS = [] |
31 |
| - |
32 | 31 |
|
33 | 32 | # Application definition
|
34 | 33 |
|
|
47 | 46 | 'django.middleware.common.CommonMiddleware',
|
48 | 47 | 'django.middleware.csrf.CsrfViewMiddleware',
|
49 | 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
| 49 | + 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
50 | 50 | 'django.contrib.messages.middleware.MessageMiddleware',
|
51 | 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
52 | 52 | )
|
|
57 | 57 |
|
58 | 58 |
|
59 | 59 | # Database
|
60 |
| -# https://docs.djangoproject.com/en/1.6/ref/settings/#databases |
61 |
| - |
62 |
| -# Parse database configuration from $DATABASE_URL |
| 60 | +# https://docs.djangoproject.com/en/1.7/ref/settings/#databases |
63 | 61 |
|
64 | 62 | DATABASES = {
|
65 |
| - 'default': dj_database_url.config(default='sqlite:///'+os.path.join(BASE_DIR, 'db.sqlite3')) |
| 63 | + 'default': { |
| 64 | + 'ENGINE': 'django.db.backends.sqlite3', |
| 65 | + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
| 66 | + } |
66 | 67 | }
|
67 | 68 |
|
68 | 69 | # Internationalization
|
69 |
| -# https://docs.djangoproject.com/en/1.6/topics/i18n/ |
| 70 | +# https://docs.djangoproject.com/en/1.7/topics/i18n/ |
70 | 71 |
|
71 | 72 | LANGUAGE_CODE = 'en-us'
|
72 |
| - |
73 | 73 | TIME_ZONE = 'UTC'
|
74 |
| - |
75 | 74 | USE_I18N = True
|
76 |
| - |
77 | 75 | USE_L10N = True
|
78 |
| - |
79 | 76 | USE_TZ = True
|
80 | 77 |
|
81 | 78 |
|
82 |
| -# Static files (CSS, JavaScript, Images) |
83 |
| -# https://docs.djangoproject.com/en/1.6/howto/static-files/ |
| 79 | +# Parse database configuration from $DATABASE_URL |
| 80 | +DATABASES['default'] = dj_database_url.config() |
84 | 81 |
|
85 |
| -STATIC_URL = '/static/' |
| 82 | +# Enable Connection Pooling (if desired) |
| 83 | +DATABASES['default']['ENGINE'] = 'django_postgrespool' |
86 | 84 |
|
87 | 85 | # Honor the 'X-Forwarded-Proto' header for request.is_secure()
|
88 | 86 | SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
89 | 87 |
|
90 | 88 | # Allow all host headers
|
91 | 89 | ALLOWED_HOSTS = ['*']
|
92 | 90 |
|
93 |
| -# Static asset configuration |
| 91 | +# Static files (CSS, JavaScript, Images) |
| 92 | +# https://docs.djangoproject.com/en/1.7/howto/static-files/ |
| 93 | + |
94 | 94 | BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
95 | 95 | STATIC_ROOT = 'staticfiles'
|
96 | 96 | STATIC_URL = '/static/'
|
97 | 97 |
|
98 | 98 | STATICFILES_DIRS = (
|
99 | 99 | os.path.join(BASE_DIR, 'static'),
|
100 | 100 | )
|
| 101 | + |
| 102 | +# Simplified static file serving. |
| 103 | +# https://warehouse.python.org/project/whitenoise/ |
| 104 | +STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage' |
| 105 | + |
0 commit comments