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

Replace Flask's url_for with app_template_url_for #430

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rnagle
Copy link

@rnagle rnagle commented Nov 10, 2014

app_template_url_for is a little helper function that takes into account the deployment target when building urls. It inserts the project's slug/path prefix when building for staging or prod.

Note that I'm overriding Flask's url_for with app_template_url_for in app.py.

Also added static_folder='www/assets' to the Flask instance so that {{ url_for('static', filename="some_file.png") }} works properly when some_file.png is in www/assets/.

I wrote this because I couldn't find a way to configure the Flask object to do this for me. Maybe I'm missing something. Let me know what you think!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant