Merge pull request #6936 from rjsparks/static_statics

refactor: use statics.ietf.org for all statics
This commit is contained in:
Robert Sparks 2024-01-19 14:57:25 -06:00 committed by GitHub
commit 6da9dff354
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 22 deletions

View file

@ -28,26 +28,6 @@ def already_ran():
checks_run.append(name)
return False
@checks.register('directories')
def check_cdn_directory_exists(app_configs, **kwargs):
"""This checks that the path from which the CDN will serve static files for
this version of the datatracker actually exists. In development and test
mode STATIC_ROOT will normally be just static/, but in production it will be
set to a different part of the file system which is served via CDN, and the
path will contain the datatracker release version.
"""
if already_ran():
return []
#
errors = []
if settings.SERVER_MODE == 'production' and not os.path.exists(settings.STATIC_ROOT):
errors.append(checks.Error(
"The static files directory has not been set up.",
hint="Please run 'ietf/manage.py collectstatic'.",
obj=None,
id='datatracker.E001',
))
return errors
@checks.register('files')
def check_group_email_aliases_exists(app_configs, **kwargs):

View file

@ -169,8 +169,8 @@ if SERVER_MODE != 'production' and SERVE_CDN_FILES_LOCALLY_IN_DEV_MODE:
STATIC_URL = "/static/"
STATIC_ROOT = os.path.abspath(BASE_DIR + "/../static/")
else:
STATIC_URL = "https://www.ietf.org/lib/dt/%s/"%__version__
STATIC_ROOT = "/a/www/www6s/lib/dt/%s/"%__version__
STATIC_URL = "https://static.ietf.org/lib/%s/"%__version__
# Intentionally not setting STATIC_ROOT - see django/django (the default is None)
# List of finder classes that know how to find static files in
# various locations.