Access to rout /admin in Flask-Admin



  • Help build Flask-admin. The module has an access control function (e.g. www.yourapp.com/admin/event, but it does not work simply at www.yourapp.com/admin). How do you fix that?



  • After the autopsy, we have to set up the decorator.

    @cp.route('/pattern_filters', methods=['GET'])
    @login_required
    def pattern_filter():
     pass
    

    or for blueprint

    @cp.before_request
    def before_request():
        if not current_user.is_authenticated:
            return redirect('/login')
    



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2