cannot use override_assets with an absolute path #1229

Closed
mmerickel opened this Issue Jan 23, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@mmerickel
Member

mmerickel commented Jan 23, 2014

Maybe this is for good reason, but here's why I want it.

Currently add_static_view doesn't support url generation if you use an absolute path. If you do config.add_static_view('static', '/home/foo/assets'), there's no way to use request.static_url(...) to generate a url to a file in that folder. This is a flaw in add_static_view, but it's solvable if we allow overriding.

However, if we could override assets, then it would work by making a dummy asset spec.

config.add_static_view('static', 'mypkg:external_assets')
config.override_asset(to_override='mypkg:external_assets/', override_with='/home/foo/assets/')

request.static_url('mypkg:external_assets/funny_picture.png')
@marioidival

This comment has been minimized.

Show comment
Hide comment
@marioidival

marioidival Feb 25, 2014

you try use request.static_url('mypkg:external_assets/whatever.*') ?

you try use request.static_url('mypkg:external_assets/whatever.*') ?

@mmerickel

This comment has been minimized.

Show comment
Hide comment
@mmerickel

mmerickel Feb 25, 2014

Member

I think you're missing the point of my example.

Member

mmerickel commented Feb 25, 2014

I think you're missing the point of my example.

@kamalgill

This comment has been minimized.

Show comment
Hide comment
@kamalgill

kamalgill Jun 6, 2014

Contributor

Would be great to have this land in Pyramid 1.6.

Contributor

kamalgill commented Jun 6, 2014

Would be great to have this land in Pyramid 1.6.

@mmerickel mmerickel closed this in #1252 Nov 18, 2014

@mmerickel mmerickel added this to the 1.6 milestone Feb 6, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment