问题
I have an app that contains 3 apps within. 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.
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)?
Structure of files
Flask/
-application.py
-requirements.txt
-settings.py
-static/
-css/
-js/
-etc/
-templates/
-app1/ **with index.html, etc within.
-app2/ (app I want to make static)
-app3/
回答1:
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:
frozen = Freezer(with_no_argument_rules=False, log_url_for=False)
@frozen.register_generator
def your_generator_here():
yield "your", {"paths": "here"}
来源:https://stackoverflow.com/questions/26937727/can-you-choose-what-files-frozen-flask-freezes