我正在使用 Flask 开发 SAAS 应用程序,我希望用户能够创建/上传/使用他们自己的自定义模板。这就是我现在的目录结构:
/flaskapp
/application.py
/static
/style.css
/templates (site & admin templates goes here)
/hello.html
/userdata
/user1
/template1
hello.html
/template2
hello.html
/user2
/template1
hello.html
/template2
hello.html
我可以使用通过这个 stackoverflow 问题找到的解决方案为用户指定的模板提供服务:如何动态选择要在烧瓶中使用的模板目录?但是如何从模板目录提供静态文件。而不是从我提供静态文件,/flaskapp/static/
我想使用/flaskapp/userdata/<user>/<current-template>/static/
目录提供静态文件,并且将在运行时动态确定。这个怎么做?