代码拉取完成,页面将自动刷新
# -*- encoding:utf-8 -*-
from main import app
from flask import g, session, request
from flask import render_template
from functools import wraps
import os, sys
import re
def get_module(path, current_module = 'controllers', parent_module = ''):
if parent_module=="" :
module_name = current_module
else:
module_name = '%s.%s' % (parent_module, current_module)
path = os.path.join(path, current_module)
files = os.listdir(path)
files.reverse()
for item in files:
if os.path.isdir(os.path.join(path, item)):
get_module(path, item, module_name)
else:
res = re.match(r'((?!__init__).*)\.py$', item)
if not res:
continue
m = res.group(1)
__import__('%s.%s' % (module_name, m))
@app.errorhandler(404)
def to_404(error):
return '<h2>页面飞走了</h2>'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。