我在看一个开源应用程序https://github.com/AlvinCJin/deepfit-app/tree/master/app
这是使用flask admin进行管理/在页面https://github.com/AlvinCJin/deepfit-app/blob/master/app/main/views.py:
# admin management setup
admin.add_view(ModelView(User, db.session))
admin.add_view(ModelView(Post, db.session))
path = op.join(os.path.abspath(__file__ + "/../../"), 'static') # need to get parent path of this code
admin.add_view(FileAdmin(path, '/static/', name='Static Files'))
这在生成有用的仪表板方面工作得很好,但不安全。在
我已经安装了flask login并阅读了http://flask-admin.readthedocs.io/en/latest/introduction/#rolling-your-own部分,但我不清楚如何链接所讨论的类:
^{pr2}$管理路线。我已经习惯了将路由链接到flask中的模块函数,而不是类。在
如何做到这一点?在
目前没有回答
相关问题 更多 >
编程相关推荐