mitsuhiko/flask — Issue #376: Blueprints overwrite their templates_directory
Author: tomekwojcik
Created: 2012-01-10 14:08:43+00:00
State: open

I have an app with two blueprints - `admin` and `default`. Both are stored in separate packages - `app.modules.admin` and `app.modules.default`. Both have separate `templates` and `static` folders. `default` is registered first (w/o `url_prefix`), `admin` is registered second (with `url_prefix='admin'`). Now, when rendering a template in an `admin` view function Flask searches for the file first in `default/templates` and then in `admin/templates`, so if I have file `home/index.html` in both blueprints (which is my case) Flask loads the file from first registered blueprint (`default` in my case), totally ignoring paths. The same goes for templates loaded with `extends` statement.