use cloudfront instead of flask to serve static images

branding in emails was previously hosted from admin app - this changes
the url to be static.{domain}/images instead of {domain}/static/images,
which redirects to cloudfront.

some manipulation of the URL was required to make sure it still serves
locally rather than returning "static.localhost:6012" for example.

(if ADMIN_BASE_URL is localhost it just returns the old /static/
path)

also was able to remove DB interaction from a test. woo!
This commit is contained in:
Leo Hemsted
2016-12-21 16:15:18 +00:00
parent 6bf024569a
commit 5cbe4eb5b2
4 changed files with 67 additions and 12 deletions

View File

@@ -59,7 +59,7 @@ class Config(object):
SQLALCHEMY_TRACK_MODIFICATIONS = True
PAGE_SIZE = 50
SMS_CHAR_COUNT_LIMIT = 495
BRANDING_PATH = '/static/images/email-template/crests/'
BRANDING_PATH = '/images/email-template/crests/'
TEST_MESSAGE_FILENAME = 'Test message'
NOTIFY_SERVICE_ID = 'd6aa2c68-a2d9-4437-ab19-3ae8eb202553'