Use this decorator to expose views in your view classes.
Parameters: |
|
---|
Decorator to expose Flask’s pluggable view classes (flask.views.View or flask.views.MethodView).
Parameters: | url – Relative URL for the view |
---|
New in version 1.0.4.
Base administrative view.
Derive from this class to implement your administrative interface piece. For example:
from flask.ext.admin import BaseView, expose
class MyView(BaseView):
@expose('/')
def index(self):
return 'Hello World!'
Generate URL for the endpoint. If you want to customize URL generation logic (persist some query string argument, for example), this is right place to do it.
Parameters: |
|
---|
Handle the response to inaccessible views.
By default, it throw HTTP 403 error. Override this method to customize the behaviour.
Override this method to add permission checks.
Flask-Admin does not make any assumptions about the authentication system used in your application, so it is up to you to implement it.
By default, it will allow access for everyone.
Default administrative interface index page when visiting the /admin/ URL.
It can be overridden by passing your own view class to the Admin constructor:
class MyHomeView(AdminIndexView):
@expose('/')
def index(self):
arg1 = 'Hello'
return render_template('adminhome.html', arg1=arg1)
admin = Admin(index_view=MyHomeView())
Default values for the index page are:
Collection of the admin views. Also manages menu structure.
Register all views with the Flask application.
Parameters: | app – Flask application instance |
---|
Return the menu hierarchy.
Return menu links.