flask-admin icon indicating copy to clipboard operation
flask-admin copied to clipboard

Template folder confliction between flask-admin and flask blueprint

Open maateen opened this issue 10 years ago • 1 comments

First of all I like to show you my test project skeleton:

app.py
app/
|--mysite/
|--------__init__.py
|--------models.py
|--------views.py
|--------templates/
|-----------------index.html
|--admin/
|--------__init__.py
|--------models.py
|--------views.py
|--------templates/
|-----------------editor.html

In app.py, the codes are like below:

from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_admin import Admin

app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)

Now, please let me make something clear. In mysite folder I'll make a flask blueprint, which has a template file index.php in templates folder. After that, I'll try to make an admin folder to initialize flask-admin admin object. This folder also has a templates folder. I like to override flask-admin base templates with the editor.html template in regarding templates folder. When I try, the flask-admin admin object only check in the blueprint templates folder. But I need different templates folder for mysite and admin. Any example for this, please?

maateen avatar Jan 09 '16 17:01 maateen

Same problem I have... flask documentation sucks...one leads to another and there is no head and tail..

sajuvs avatar Dec 19 '21 23:12 sajuvs