Flask实例化
flask
Flask实例化配置
| Flask(__name__, static_folder='mystatic', static_url_path='/myurl',template_folder='mytemplate')
static_folder = 'static'
static_url_path = None,
template_folder = 'templates'
|
1 2 3 4 5 6 7 8 9 10 11 12
| path = str((Path(__file__).parent).absolute())+"/test1/static" 设置template和static路径 app = Flask(__name__,template_folder='../test1/templates',static_folder=path) 此时实例化后参数为 static_folder /..../test1/static static_url_path /static template_folder ../test1/templates
|