Skip to content

Commit 669638d

Browse files
committed
Simplified the static setup, using one single static location with full collectstatic usage, instead of a split static setup.
- Legacy-Id: 9949
1 parent 1d83480 commit 669638d

1 file changed

Lines changed: 11 additions & 16 deletions

File tree

ietf/settings.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,22 @@
100100

101101
# Absolute path to the directory static files should be collected to.
102102
# Example: "/var/www/example.com/static/"
103-
STATIC_ROOT = os.path.abspath(BASE_DIR + "/../static/lib/")
104103

104+
CDN_ROOT = "/a/www/www6s/lib/dt"
105105

106106
SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE = True
107107

108108
# URL to use when referring to static files located in STATIC_ROOT.
109109
if SERVER_MODE != 'production' and SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE:
110-
STATIC_URL = "/lib/"
111-
STATIC_CDN_PATH = STATIC_ROOT
110+
STATIC_URL = "/static/"
111+
STATIC_ROOT = os.path.abspath(BASE_DIR + "/../static/")
112112
else:
113113
STATIC_URL = "https://www.ietf.org/lib/dt/%s/"%__version__
114-
STATIC_CDN_PATH = "/a/www/www6s/lib/dt/%s/"%__version__
114+
STATIC_ROOT = CDN_ROOT + "%s/"%__version__
115115

116116
# Destination for components handled by djangobower
117-
COMPONENT_ROOT = STATIC_ROOT
117+
COMPONENT_ROOT = BASE_DIR + "/externals/static/"
118+
COMPONENT_URL = STATIC_URL
118119

119120
# List of finder classes that know how to find static files in
120121
# various locations.
@@ -124,11 +125,6 @@
124125
'ietf.utils.bower_storage.BowerStorageFinder',
125126
)
126127

127-
128-
# Absolute path to the files not served through the staticfiles app
129-
STATIC_LOCAL = os.path.abspath(BASE_DIR + "/../static/")
130-
131-
132128
WSGI_APPLICATION = "ietf.wsgi.application"
133129

134130
AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', )
@@ -222,14 +218,14 @@ def skip_unreadable_post(record):
222218
'ietf.context_processors.server_mode',
223219
'ietf.context_processors.revision_info',
224220
'ietf.secr.context_processors.secr_revision_info',
225-
'ietf.secr.context_processors.static',
226221
'ietf.context_processors.rfcdiff_base_url',
227222
)
228223

229-
# Additional locations of static files
224+
# Additional locations of static files (in addition to each app's static/ dir)
230225
STATICFILES_DIRS = (
231226
os.path.join(BASE_DIR, 'static'),
232-
os.path.join(BASE_DIR, '../bootstrap/static'),
227+
os.path.join(BASE_DIR, 'secr/static'),
228+
os.path.join(BASE_DIR, 'externals/static'),
233229
)
234230

235231
INSTALLED_APPS = (
@@ -359,9 +355,9 @@ def skip_unreadable_post(record):
359355
if len(TEST_CODE_COVERAGE_CHECKER.collector._collectors) == 0:
360356
TEST_CODE_COVERAGE_CHECKER.start()
361357

362-
TEST_CODE_COVERAGE_REPORT_PATH = "static/coverage/"
358+
TEST_CODE_COVERAGE_REPORT_PATH = "coverage/"
363359
TEST_CODE_COVERAGE_REPORT_URL = os.path.join(STATIC_URL, TEST_CODE_COVERAGE_REPORT_PATH, "index.html")
364-
TEST_CODE_COVERAGE_REPORT_DIR = os.path.join(STATIC_ROOT, TEST_CODE_COVERAGE_REPORT_PATH)
360+
TEST_CODE_COVERAGE_REPORT_DIR = os.path.join(BASE_DIR, "static", TEST_CODE_COVERAGE_REPORT_PATH)
365361
TEST_CODE_COVERAGE_REPORT_FILE = os.path.join(TEST_CODE_COVERAGE_REPORT_DIR, "index.html")
366362

367363
# WG Chair configuration
@@ -527,7 +523,6 @@ def skip_unreadable_post(record):
527523
SECR_INTERIM_LISTING_DIR = '/a/www/www6/meeting/interim'
528524
SECR_MAX_UPLOAD_SIZE = 40960000
529525
SECR_PROCEEDINGS_DIR = '/a/www/www6s/proceedings/'
530-
SECR_STATIC_URL = '/secretariat/'
531526
SECR_PPT2PDF_COMMAND = ['/usr/bin/soffice','--headless','--convert-to','pdf','--outdir']
532527

533528
USE_ETAGS=True

0 commit comments

Comments
 (0)