Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows to serve static asserts on an external CDN domain #1804

Merged
merged 1 commit into from Jul 26, 2018

Conversation

@noirbizarre
Copy link
Member

commented Jul 26, 2018

This PR allows to serve static assets from an external CDN defined by CDN_DOMAIN.

@noirbizarre noirbizarre added this to the 1.4.2 milestone Jul 26, 2018
@noirbizarre noirbizarre self-assigned this Jul 26, 2018
@noirbizarre noirbizarre requested a review from opendatateam/etalab Jul 26, 2018
@noirbizarre noirbizarre force-pushed the noirbizarre:static-cdn branch from 5402e97 to aceee7f Jul 26, 2018
@abulte
abulte approved these changes Jul 26, 2018

**default**: `None`

Set this to a domain name. If defined, udata will serve it's static assets from this domain.

This comment has been minimized.

Copy link
@abulte

abulte Jul 26, 2018

Member

s/it's/its/

@@ -35,6 +36,12 @@ def now():
return datetime.now()


def cdn_for(endpoint, **kwargs):

This comment has been minimized.

Copy link
@abulte

abulte Jul 26, 2018

Member

Not a fan of the name. cdn_or_flask_url_for ? Not great either :-/ but more descriptive.

This comment has been minimized.

Copy link
@noirbizarre

noirbizarre Jul 26, 2018

Author Member

This is only meant to be used for CDN assets, not as a replacement for all flask url_for.
I kept the name but added a docstring to be more explicit.

@noirbizarre noirbizarre force-pushed the noirbizarre:static-cdn branch 2 times, most recently from 3745758 to 80536ec Jul 26, 2018
@noirbizarre noirbizarre force-pushed the noirbizarre:static-cdn branch from 80536ec to cbb4143 Jul 26, 2018
@noirbizarre noirbizarre merged commit c530203 into opendatateam:master Jul 26, 2018
3 checks passed
3 checks passed
ci/circleci: assets Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: python Your tests passed on CircleCI!
Details
@noirbizarre noirbizarre deleted the noirbizarre:static-cdn branch Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.