Skip to content

Allow overwritten on render_template to use Flask-Themes based app #179 #180

merged 6 commits into from Jan 24, 2014

3 participants


I am sending this PR just for you to see if it is a good way, or it there is a better idea..

remembering the goal is allow this:

from import Security as _Security
from myapp.templates import custom_render_template

class Security(_Security):
    def render_template(self, *args, **kwargs):
        return custom_render_template(*args, **kwargs)



The other version of this would change only two line on views file.

from werkzeug.utils import import_string
render_template = import_string(
    current_app.config.get('SECURITY_RENDER', 'flask:render_template')

But I am not sure about the lazyness of this, can raise RunTimeError("Out of app scope")

I am going with the current implementation, injecting render_template on _SecurityState instance.

thrisp commented Nov 12, 2013

In what situations do you use a custom render template function?


@rochacbruno This is good to go, but please do not change version numbers. I can merge this if you revert the version number back. Also, please merge the upstream to get up to date. Thanks!


@mattupstate done! I changed the reverted version change and merged upstream (develop branch)


Travis is broken because of a Flask-Login issue maxcountryman/flask-login#135


@rochacbruno Might you want to merge the upstream and try this again?

@mattupstate mattupstate merged commit c0673c1 into mattupstate:develop Jan 24, 2014

1 check passed

Details default The Travis CI build passed


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.