【问题标题】:Is there anyway to specify templates and static folders(other than default) for Connexion app?有没有为 Connexion 应用程序指定模板和静态文件夹(默认除外)?
【发布时间】:2020-03-11 21:25:56
【问题描述】:

我正在使用这样的 connexion 2.4.0 库初始化应用程序:

connex_app = connexion.App(__name__, specification_dir='./')
app = connex_app.app

我需要以某种方式指定静态和模板目录的路径,因为它们不在根目录中。 在 Flask 中我会使用这样的东西

app = Flask(__name__, static_folder='../frontEnd/static', template_folder='../frontEnd/templates')

我知道 connexion 默认在根目录中查找静态和模板,但是有什么方法可以指示其他路径吗?

【问题讨论】:

    标签: python flask connexion


    【解决方案1】:

    关于这个问题有一个开放的问题:

    还有一个开放的拉取请求:

    但问题并没有解决。 你可以用这种方法How to set static_url_path in Flask application 记住使用 app.app 来访问烧瓶实例。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-23
      • 2014-09-02
      • 2012-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多