Adding Contact Page to Flask Admin Adding Contact Page to Flask Admin flask flask

Adding Contact Page to Flask Admin


You need to use flask_admin.base.BaseView.render method to process your templates with flask-admin context. It may look like this:

from flask_admin import BaseView, exposeclass ContactsView(BaseView):    @expose('/')    def index(self):        # Here are the contents of your "contact" route function        return self.render('contact.html', form=form, admin=admin)

You can activate this view the same way as ModelView instances:

admin.add_view(ContactsView('Contacts', url='/contacts'))