|
21 | 21 |
|
22 | 22 | import datetime |
23 | 23 |
|
| 24 | +from ietf import __version__ |
| 25 | + |
24 | 26 | DEBUG = True |
25 | 27 | TEMPLATE_DEBUG = DEBUG |
26 | 28 |
|
| 29 | +# Valid values: |
| 30 | +# 'production', 'test', 'development' |
| 31 | +# Override this in settings_local.py if it's not the desired setting: |
| 32 | +SERVER_MODE = 'development' |
| 33 | + |
27 | 34 | # Domain name of the IETF |
28 | 35 | IETF_DOMAIN = 'ietf.org' |
29 | 36 |
|
|
91 | 98 |
|
92 | 99 | MEDIA_URL = 'https://www.ietf.org/' |
93 | 100 |
|
94 | | -STATIC_URL = "/" |
95 | | -STATIC_ROOT = os.path.abspath(BASE_DIR + "/../static/") |
| 101 | +# Absolute path to the directory static files should be collected to. |
| 102 | +# Example: "/var/www/example.com/static/" |
| 103 | +STATIC_ROOT = os.path.abspath(BASE_DIR + "/../static/lib/") |
| 104 | + |
| 105 | + |
| 106 | +SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE = True |
| 107 | + |
| 108 | +# URL to use when referring to static files located in STATIC_ROOT. |
| 109 | +if SERVER_MODE != 'production' and SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE: |
| 110 | + STATIC_URL = "/lib/" |
| 111 | +else: |
| 112 | + STATIC_URL = "https://www.ietf.org/lib/dt/%s/"%__version__ |
| 113 | + |
| 114 | +# Destination for components handled by djangobower |
| 115 | +COMPONENT_ROOT = STATIC_ROOT |
| 116 | + |
| 117 | +# List of finder classes that know how to find static files in |
| 118 | +# various locations. |
| 119 | +STATICFILES_FINDERS = ( |
| 120 | + 'django.contrib.staticfiles.finders.FileSystemFinder', |
| 121 | + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', |
| 122 | + 'ietf.storage.CdnStorageFinder', |
| 123 | +) |
| 124 | + |
| 125 | + |
| 126 | +# Absolute path to the files not served through the staticfiles app |
| 127 | +STATIC_LOCAL = os.path.abspath(BASE_DIR + "/../static/") |
| 128 | + |
96 | 129 |
|
97 | 130 | WSGI_APPLICATION = "ietf.wsgi.application" |
98 | 131 |
|
@@ -191,19 +224,26 @@ def skip_unreadable_post(record): |
191 | 224 | 'ietf.context_processors.rfcdiff_base_url', |
192 | 225 | ) |
193 | 226 |
|
| 227 | +# Additional locations of static files |
| 228 | +STATICFILES_DIRS = ( |
| 229 | + os.path.join(BASE_DIR, 'static'), |
| 230 | +) |
| 231 | + |
194 | 232 | INSTALLED_APPS = ( |
195 | 233 | # Django apps |
196 | | - 'django.contrib.auth', |
197 | | - 'django.contrib.contenttypes', |
198 | | - 'django.contrib.sessions', |
199 | | - 'django.contrib.sites', |
200 | | - 'django.contrib.sitemaps', |
201 | 234 | 'django.contrib.admin', |
202 | 235 | 'django.contrib.admindocs', |
| 236 | + 'django.contrib.auth', |
| 237 | + 'django.contrib.contenttypes', |
203 | 238 | 'django.contrib.humanize', |
204 | 239 | 'django.contrib.messages', |
| 240 | + 'django.contrib.sessions', |
| 241 | + 'django.contrib.sitemaps', |
| 242 | + 'django.contrib.sites', |
| 243 | + 'django.contrib.staticfiles', |
205 | 244 | # External apps |
206 | 245 | 'bootstrap3', |
| 246 | + 'djangobwr', |
207 | 247 | 'form_utils', |
208 | 248 | 'tastypie', |
209 | 249 | 'widget_tweaks', |
@@ -278,11 +318,6 @@ def skip_unreadable_post(record): |
278 | 318 | IDTRACKER_BASE_URL = "https://datatracker.ietf.org" |
279 | 319 | RFCDIFF_BASE_URL = "https://www.ietf.org/rfcdiff" |
280 | 320 |
|
281 | | -# Valid values: |
282 | | -# 'production', 'test', 'development' |
283 | | -# Override this in settings_local.py if it's not true |
284 | | -SERVER_MODE = 'development' |
285 | | - |
286 | 321 | # The name of the method to use to invoke the test suite |
287 | 322 | TEST_RUNNER = 'ietf.utils.test_runner.IetfTestRunner' |
288 | 323 |
|
|
0 commit comments