老师 按照你的操作 静态文件我都加载不出来
来源:5-1 管理员登录和列表页面
慕慕3583558
2019-10-22
class Application(Flask):
def init(self,import_name,template_folder = None,root_path = None):
super(Application,self).init(import_name,template_folder=template_folder,root_path=root_path,static_folder = None)
self.config.from_pyfile(‘config/base_setting.py’)
if 'ops_config' in os.environ:
self.config.from_pyfile('config/%s_setting.py'%os.environ['ops_config'])
db.init_app(self)
db = SQLAlchemy()
app = Application(name,template_folder=os.getcwd()+’/web/templates/’,root_path=os.getcwd())
manager = Manager(app)
‘’’
函数模版
’’'
from common.libs.UrlManager import UrlManage
app.add_template_global(UrlManage.buildStaticUrl,‘buildStaticUrl’)
app.add_template_global(UrlManage.buildUrl,‘buildUrl’)
写回答
1回答
-
编程浪子
2019-10-24
00
相似问题