Merge pull request #2542 from alphagov/static-domain

Use static domains for static assets
This commit is contained in:
Chris Hill-Scott
2018-11-29 09:58:38 +00:00
committed by GitHub
2 changed files with 6 additions and 1 deletions

View File

@@ -194,7 +194,7 @@ def init_app(application):
@application.context_processor
def inject_global_template_variables():
return {
'asset_path': '/static/',
'asset_path': application.config['ASSET_PATH'],
'header_colour': application.config['HEADER_COLOUR'],
'asset_url': asset_fingerprinter.get_url
}

View File

@@ -74,6 +74,8 @@ class Config(object):
REDIS_URL = os.environ.get('REDIS_URL')
REDIS_ENABLED = os.environ.get('REDIS_ENABLED') == '1'
ASSET_PATH = '/static/'
class Development(Config):
NOTIFY_LOG_PATH = 'application.log'
@@ -117,6 +119,7 @@ class Preview(Config):
MOU_BUCKET_NAME = 'notify.works-mou'
NOTIFY_ENVIRONMENT = 'preview'
CHECK_PROXY_HEADER = False
ASSET_PATH = 'https://static.notify.works/'
class Staging(Config):
@@ -129,6 +132,7 @@ class Staging(Config):
MOU_BUCKET_NAME = 'staging-notify.works-mou'
NOTIFY_ENVIRONMENT = 'staging'
CHECK_PROXY_HEADER = False
ASSET_PATH = 'https://static.staging-notify.works/'
class Live(Config):
@@ -141,6 +145,7 @@ class Live(Config):
MOU_BUCKET_NAME = 'notifications.service.gov.uk-mou'
NOTIFY_ENVIRONMENT = 'live'
CHECK_PROXY_HEADER = False
ASSET_PATH = 'https://static.notifications.service.gov.uk/'
class CloudFoundryConfig(Config):