Flask packs do not compile when run under uWSGI

They start normally when I launch the flash application directly, but I donโ€™t compile or replace the address in the template when working under uWSGI.

How can I debug this?

EDIT:

code: assets = Environment (application)

... if __name__ == "__main__": assets.register(YAMLLoader(os.path.join(DIR,"assets.yml")).load_bundles()) if os.environ.get("DEBUG_FLASK"): app.run() else: app.run(debug=True) 

assets.yml:

 style_css: filters: less output: css/style.css contents: - css/style.less 
+6
source share
1 answer

Turns out uwsgi does its job with an application variable to run webapp and doesn't run a script like __main__, so

 assets.register(YAMLLoader(os.path.join(DIR,"assets.yml")).load_bundles()) 

never called. I moved it from

 if __name__ == "__main__": 

block. And it worked.

0
source

All Articles