bgneal@1
|
1 # Django base settings for bns_website project.
|
bgneal@1
|
2
|
bgneal@1
|
3 import json
|
bgneal@1
|
4 import os
|
bgneal@1
|
5
|
bgneal@1
|
6 PROJECT_PATH = os.path.abspath(os.path.join(os.path.split(__file__)[0], '..'))
|
bgneal@0
|
7
|
bgneal@0
|
8 DEBUG = True
|
bgneal@0
|
9 TEMPLATE_DEBUG = DEBUG
|
bgneal@0
|
10
|
bgneal@1
|
11 ADMINS = [
|
bgneal@1
|
12 ('Brian Neal', 'bgneal@gmail.com'),
|
bgneal@1
|
13 ]
|
bgneal@0
|
14
|
bgneal@0
|
15 MANAGERS = ADMINS
|
bgneal@0
|
16
|
bgneal@0
|
17 DATABASES = {
|
bgneal@0
|
18 'default': {
|
bgneal@0
|
19 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
|
bgneal@0
|
20 'NAME': '', # Or path to database file if using sqlite3.
|
bgneal@0
|
21 'USER': '', # Not used with sqlite3.
|
bgneal@0
|
22 'PASSWORD': '', # Not used with sqlite3.
|
bgneal@0
|
23 'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
|
bgneal@0
|
24 'PORT': '', # Set to empty string for default. Not used with sqlite3.
|
bgneal@0
|
25 }
|
bgneal@0
|
26 }
|
bgneal@0
|
27
|
bgneal@0
|
28 # Local time zone for this installation. Choices can be found here:
|
bgneal@0
|
29 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
bgneal@0
|
30 # although not all choices may be available on all operating systems.
|
bgneal@0
|
31 # On Unix systems, a value of None will cause Django to use the same
|
bgneal@0
|
32 # timezone as the operating system.
|
bgneal@0
|
33 # If running in a Windows environment this must be set to the same as your
|
bgneal@0
|
34 # system time zone.
|
bgneal@0
|
35 TIME_ZONE = 'America/Chicago'
|
bgneal@0
|
36
|
bgneal@0
|
37 # Language code for this installation. All choices can be found here:
|
bgneal@0
|
38 # http://www.i18nguy.com/unicode/language-identifiers.html
|
bgneal@0
|
39 LANGUAGE_CODE = 'en-us'
|
bgneal@0
|
40
|
bgneal@0
|
41 SITE_ID = 1
|
bgneal@0
|
42
|
bgneal@0
|
43 # If you set this to False, Django will make some optimizations so as not
|
bgneal@0
|
44 # to load the internationalization machinery.
|
bgneal@1
|
45 USE_I18N = False
|
bgneal@0
|
46
|
bgneal@0
|
47 # If you set this to False, Django will not format dates, numbers and
|
bgneal@0
|
48 # calendars according to the current locale
|
bgneal@0
|
49 USE_L10N = True
|
bgneal@0
|
50
|
bgneal@0
|
51 # Absolute filesystem path to the directory that will hold user-uploaded files.
|
bgneal@0
|
52 # Example: "/home/media/media.lawrence.com/media/"
|
bgneal@2
|
53 MEDIA_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'media'))
|
bgneal@0
|
54
|
bgneal@0
|
55 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
bgneal@0
|
56 # trailing slash.
|
bgneal@0
|
57 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
|
bgneal@1
|
58 MEDIA_URL = '/media/'
|
bgneal@0
|
59
|
bgneal@0
|
60 # Absolute path to the directory static files should be collected to.
|
bgneal@0
|
61 # Don't put anything in this directory yourself; store your static files
|
bgneal@0
|
62 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
|
bgneal@0
|
63 # Example: "/home/media/media.lawrence.com/static/"
|
bgneal@2
|
64 STATIC_ROOT = os.path.abspath(os.path.join(PROJECT_PATH, '..', 'static'))
|
bgneal@0
|
65
|
bgneal@0
|
66 # URL prefix for static files.
|
bgneal@0
|
67 # Example: "http://media.lawrence.com/static/"
|
bgneal@0
|
68 STATIC_URL = '/static/'
|
bgneal@0
|
69
|
bgneal@0
|
70 # URL prefix for admin static files -- CSS, JavaScript and images.
|
bgneal@0
|
71 # Make sure to use a trailing slash.
|
bgneal@0
|
72 # Examples: "http://foo.com/static/admin/", "/static/admin/".
|
bgneal@0
|
73 ADMIN_MEDIA_PREFIX = '/static/admin/'
|
bgneal@0
|
74
|
bgneal@0
|
75 # Additional locations of static files
|
bgneal@1
|
76 STATICFILES_DIRS = [
|
bgneal@0
|
77 # Put strings here, like "/home/html/static" or "C:/www/django/static".
|
bgneal@0
|
78 # Always use forward slashes, even on Windows.
|
bgneal@0
|
79 # Don't forget to use absolute paths, not relative paths.
|
bgneal@1
|
80 os.path.join(PROJECT_PATH, 'static'),
|
bgneal@1
|
81 ]
|
bgneal@0
|
82
|
bgneal@0
|
83 # List of finder classes that know how to find static files in
|
bgneal@0
|
84 # various locations.
|
bgneal@0
|
85 STATICFILES_FINDERS = (
|
bgneal@0
|
86 'django.contrib.staticfiles.finders.FileSystemFinder',
|
bgneal@0
|
87 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
bgneal@0
|
88 # 'django.contrib.staticfiles.finders.DefaultStorageFinder',
|
bgneal@0
|
89 )
|
bgneal@0
|
90
|
bgneal@0
|
91 # Make this unique, and don't share it with anybody.
|
bgneal@1
|
92 SECRETS = json.load(open(os.path.join(PROJECT_PATH, 'settings', 'secrets.json')))
|
bgneal@1
|
93 SECRET_KEY = SECRETS['SECRET_KEY']
|
bgneal@0
|
94
|
bgneal@0
|
95 # List of callables that know how to import templates from various sources.
|
bgneal@0
|
96 TEMPLATE_LOADERS = (
|
bgneal@0
|
97 'django.template.loaders.filesystem.Loader',
|
bgneal@0
|
98 'django.template.loaders.app_directories.Loader',
|
bgneal@0
|
99 # 'django.template.loaders.eggs.Loader',
|
bgneal@0
|
100 )
|
bgneal@0
|
101
|
bgneal@1
|
102 MIDDLEWARE_CLASSES = [
|
bgneal@0
|
103 'django.middleware.common.CommonMiddleware',
|
bgneal@0
|
104 'django.contrib.sessions.middleware.SessionMiddleware',
|
bgneal@0
|
105 'django.middleware.csrf.CsrfViewMiddleware',
|
bgneal@0
|
106 'django.contrib.auth.middleware.AuthenticationMiddleware',
|
bgneal@0
|
107 'django.contrib.messages.middleware.MessageMiddleware',
|
bgneal@1
|
108 ]
|
bgneal@0
|
109
|
bgneal@0
|
110 ROOT_URLCONF = 'bns_website.urls'
|
bgneal@0
|
111
|
bgneal@1
|
112 TEMPLATE_DIRS = [
|
bgneal@0
|
113 # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
|
bgneal@0
|
114 # Always use forward slashes, even on Windows.
|
bgneal@0
|
115 # Don't forget to use absolute paths, not relative paths.
|
bgneal@1
|
116 os.path.join(PROJECT_PATH, 'templates'),
|
bgneal@1
|
117 ]
|
bgneal@0
|
118
|
bgneal@1
|
119 TEMPLATE_CONTEXT_PROCESSORS = [
|
bgneal@1
|
120 'django.contrib.auth.context_processors.auth',
|
bgneal@1
|
121 'django.core.context_processors.debug',
|
bgneal@1
|
122 'django.core.context_processors.request',
|
bgneal@1
|
123 'django.core.context_processors.media',
|
bgneal@1
|
124 'django.core.context_processors.static',
|
bgneal@1
|
125 ]
|
bgneal@1
|
126
|
bgneal@1
|
127 INSTALLED_APPS = [
|
bgneal@0
|
128 'django.contrib.auth',
|
bgneal@0
|
129 'django.contrib.contenttypes',
|
bgneal@0
|
130 'django.contrib.sessions',
|
bgneal@0
|
131 'django.contrib.sites',
|
bgneal@0
|
132 'django.contrib.messages',
|
bgneal@0
|
133 'django.contrib.staticfiles',
|
bgneal@1
|
134 'django.contrib.admin',
|
bgneal@1
|
135 'django.contrib.admindocs',
|
bgneal@3
|
136 'core',
|
bgneal@6
|
137 'bands',
|
bob@14
|
138 'news',
|
bgneal@1
|
139 ]
|
bgneal@0
|
140
|
bgneal@0
|
141 # A sample logging configuration. The only tangible logging
|
bgneal@0
|
142 # performed by this configuration is to send an email to
|
bgneal@0
|
143 # the site admins on every HTTP 500 error.
|
bgneal@0
|
144 # See http://docs.djangoproject.com/en/dev/topics/logging for
|
bgneal@0
|
145 # more details on how to customize your logging configuration.
|
bgneal@0
|
146 LOGGING = {
|
bgneal@0
|
147 'version': 1,
|
bgneal@0
|
148 'disable_existing_loggers': False,
|
bgneal@0
|
149 'handlers': {
|
bgneal@0
|
150 'mail_admins': {
|
bgneal@0
|
151 'level': 'ERROR',
|
bgneal@0
|
152 'class': 'django.utils.log.AdminEmailHandler'
|
bgneal@0
|
153 }
|
bgneal@0
|
154 },
|
bgneal@0
|
155 'loggers': {
|
bgneal@0
|
156 'django.request': {
|
bgneal@0
|
157 'handlers': ['mail_admins'],
|
bgneal@0
|
158 'level': 'ERROR',
|
bgneal@0
|
159 'propagate': True,
|
bgneal@0
|
160 },
|
bgneal@0
|
161 }
|
bgneal@0
|
162 }
|