I have a pretty complex Flask site and have added Flask-admin to manage various database tables. It works just fine but I already have an /admin blueprint tree with lots of management routes and templates - e.g. /admin/edit_user
So, I would like to change the flask-admin url from '/admin' to '/dbadmin' to avoid any confusion but setting url= just breaks flask-admin.
this works fine
from flask_admin import Admin
flaskadmin = Admin(name='My admin')
flaskadmin.add_view(MyModelView(Customer))
flaskadmin.add_view(MyModelView(User))
flaskadmin.init_app(app)
setting url='/dbadmin' stops /admin from working but neither does /dbadmin
flaskadmin = Admin(name='My admin', url='/dbadmin')
flaskadmin.add_view(MyModelView(Customer))
flaskadmin.add_view(MyModelView(User))
flaskadmin.init_app(app)
any ideas how to get this working?
Refer to this doc: https://flask-admin.readthedocs.io/en/latest/api/mod_base/#default-view
You need to set up an index_view class, you can then set the url to that class.
In your case it might be something like this with flask-login