Skip to content

Commit 749c56e

Browse files
author
Kenneth Reitz
committed
reorder settings around a bit
1 parent 8b4c155 commit 749c56e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

gettingstarted/settings.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010

1111
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1212
import os
13+
import dj_database_url
14+
1315
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
1416

1517

1618
# Quick-start development settings - unsuitable for production
1719
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
1820

1921
# SECURITY WARNING: keep the secret key used in production secret!
20-
SECRET_KEY = '3iy-!-d$!pc_ll$#$elg&cpr@*tfn-d5&n9ag=)%#()t$$5%5^'
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)
2124

2225
# SECURITY WARNING: don't run with debug turned on in production!
2326
DEBUG = True
@@ -83,7 +86,6 @@
8386

8487

8588
# Parse database configuration from $DATABASE_URL
86-
import dj_database_url
8789
DATABASES['default'] = dj_database_url.config()
8890

8991
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
@@ -93,7 +95,6 @@
9395
ALLOWED_HOSTS = ['*']
9496

9597
# Static asset configuration
96-
import os
9798
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
9899
STATIC_ROOT = 'staticfiles'
99100
STATIC_URL = '/static/'

0 commit comments

Comments
 (0)