简体   繁体   English

您可以选择 Frozen-Flask 冻结哪些文件吗?

[英]Can you choose what files Frozen-Flask freezes?

I have an app that contains 3 apps within.我有一个应用程序,其中包含 3 个应用程序。 One of the apps would be better if output as a static site because it is made up of static material as it is.如果输出为静态站点,其中一个应用程序会更好,因为它是由静态材料组成的。 I was able to use Frozen-Flask to create a static site application for the app on it's own, but I want to try and keep all three apps in the one WSGI app.我能够使用 Frozen-Flask 为它自己的应用程序创建一个静态站点应用程序,但我想尝试将所有三个应用程序保留在一个 WSGI 应用程序中。

So my question is, is there a way to choose what files Frozen-Flask chooses to freeze so it ignores the files in app1/ and app3/ (see file structure below)?所以我的问题是,有没有办法选择 Frozen-Flask 选择冻结的文件,以便忽略 app1/ 和 app3/ 中的文件(参见下面的文件结构)?

Structure of files文件结构

Flask/烧瓶/

-application.py -application.py

-requirements.txt -requirements.txt

-settings.py -settings.py

-static/ -静止的/

-css/ -css/

-js/ -js/

-etc/ -等等/

-templates/ -模板/

-app1/ **with index.html, etc within. -app1/ ** 包含 index.html 等。

-app2/ (app I want to make static) -app2/(我想静态化的应用程序)

-app3/ -app3/

The keyword arguments with_no_argument_rules and log_url_for can be set to False when you create your Freezer instance and then you can call register_generator to register a function or functions that will output the URLs you want to freeze:创建Freezer实例时,可以将with_no_argument_ruleslog_url_for关键字参数设置为False ,然后您可以调用register_generator来注册一个或多个函数,这些函数将输出冻结的 URL:

frozen = Freezer(with_no_argument_rules=False, log_url_for=False)

@frozen.register_generator
def your_generator_here():
    yield "your", {"paths": "here"}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM