|
@@ -0,0 +1,29 @@
|
|
|
+from flask import Flask
|
|
|
+from .init_sqlalhemy import db, ma, init_databases
|
|
|
+from .init_upload import init_upload
|
|
|
+from .init_login import init_login_manager
|
|
|
+from .init_mail import init_mail
|
|
|
+from .init_csrf import init_csrf
|
|
|
+from .init_template_directives import init_template_directives
|
|
|
+# from flasgger import Swagger
|
|
|
+# from flask_siwadoc import SiwaDoc
|
|
|
+
|
|
|
+def init_extensions(app: Flask):
|
|
|
+ """初始化flask插件"""
|
|
|
+
|
|
|
+ init_login_manager(app)
|
|
|
+ init_databases(app)
|
|
|
+ init_template_directives(app)
|
|
|
+ init_mail(app)
|
|
|
+ init_upload(app)
|
|
|
+ # init_csrf(app)
|
|
|
+
|
|
|
+ # flask-cache
|
|
|
+ # init_cache(app)
|
|
|
+ init_docs(app=app)
|
|
|
+
|
|
|
+def init_docs(app: Flask):
|
|
|
+ """ """
|
|
|
+ # swagger = Swagger(app)
|
|
|
+ # siwa = SiwaDoc(app)
|
|
|
+ pass
|