Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Overriding blueprint template does not take effect until restart #298

Open
adrianlopezroche opened this Issue · 1 comment

2 participants

@adrianlopezroche

Overriding a blueprint's template does not take effect without restarting the development server.

Follow these steps to reproduce:

  • First, add and register the following blueprint without creating any templates. It should produce a "Template Not Found" error:
from flask import Blueprint, render_template

blueprint = Blueprint(
    'blueprint', 
    __name__, 
    template_folder='blueprint/templates')

@blueprint.route('/testoverride')
def TestOverride():
    return render_template('test.html')
  • Next, add a new template called "test.html" under the blueprint's template directory and refresh the page. It should find the template without restarting the server.

  • Now add a second template having the same filename but different content under the application's template directory and refresh the page. The page's content will not change without restarting the server.

  • Restart the server and refresh the page. Confirm the content has now changed.

@mitsuhiko
Owner

This is tricky to do because of how the loaders work. For development purposes I would recommend disabling the template cache until this is properly fixed.

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.