mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
Merge pull request #2542 from alphagov/static-domain
Use static domains for static assets
This commit is contained in:
@@ -194,7 +194,7 @@ def init_app(application):
|
|||||||
@application.context_processor
|
@application.context_processor
|
||||||
def inject_global_template_variables():
|
def inject_global_template_variables():
|
||||||
return {
|
return {
|
||||||
'asset_path': '/static/',
|
'asset_path': application.config['ASSET_PATH'],
|
||||||
'header_colour': application.config['HEADER_COLOUR'],
|
'header_colour': application.config['HEADER_COLOUR'],
|
||||||
'asset_url': asset_fingerprinter.get_url
|
'asset_url': asset_fingerprinter.get_url
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,8 @@ class Config(object):
|
|||||||
REDIS_URL = os.environ.get('REDIS_URL')
|
REDIS_URL = os.environ.get('REDIS_URL')
|
||||||
REDIS_ENABLED = os.environ.get('REDIS_ENABLED') == '1'
|
REDIS_ENABLED = os.environ.get('REDIS_ENABLED') == '1'
|
||||||
|
|
||||||
|
ASSET_PATH = '/static/'
|
||||||
|
|
||||||
|
|
||||||
class Development(Config):
|
class Development(Config):
|
||||||
NOTIFY_LOG_PATH = 'application.log'
|
NOTIFY_LOG_PATH = 'application.log'
|
||||||
@@ -117,6 +119,7 @@ class Preview(Config):
|
|||||||
MOU_BUCKET_NAME = 'notify.works-mou'
|
MOU_BUCKET_NAME = 'notify.works-mou'
|
||||||
NOTIFY_ENVIRONMENT = 'preview'
|
NOTIFY_ENVIRONMENT = 'preview'
|
||||||
CHECK_PROXY_HEADER = False
|
CHECK_PROXY_HEADER = False
|
||||||
|
ASSET_PATH = 'https://static.notify.works/'
|
||||||
|
|
||||||
|
|
||||||
class Staging(Config):
|
class Staging(Config):
|
||||||
@@ -129,6 +132,7 @@ class Staging(Config):
|
|||||||
MOU_BUCKET_NAME = 'staging-notify.works-mou'
|
MOU_BUCKET_NAME = 'staging-notify.works-mou'
|
||||||
NOTIFY_ENVIRONMENT = 'staging'
|
NOTIFY_ENVIRONMENT = 'staging'
|
||||||
CHECK_PROXY_HEADER = False
|
CHECK_PROXY_HEADER = False
|
||||||
|
ASSET_PATH = 'https://static.staging-notify.works/'
|
||||||
|
|
||||||
|
|
||||||
class Live(Config):
|
class Live(Config):
|
||||||
@@ -141,6 +145,7 @@ class Live(Config):
|
|||||||
MOU_BUCKET_NAME = 'notifications.service.gov.uk-mou'
|
MOU_BUCKET_NAME = 'notifications.service.gov.uk-mou'
|
||||||
NOTIFY_ENVIRONMENT = 'live'
|
NOTIFY_ENVIRONMENT = 'live'
|
||||||
CHECK_PROXY_HEADER = False
|
CHECK_PROXY_HEADER = False
|
||||||
|
ASSET_PATH = 'https://static.notifications.service.gov.uk/'
|
||||||
|
|
||||||
|
|
||||||
class CloudFoundryConfig(Config):
|
class CloudFoundryConfig(Config):
|
||||||
|
|||||||
Reference in New Issue
Block a user