Flask application built using pyinstaller not rendering index.html

前端 未结 5 635
面向向阳花
面向向阳花 2020-12-25 15:19

I have written a flask application and it works perfectly fine. I wanted to distribute it as an executable. Tried doing it using pyinstaller flaskScript.py dist folder got

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-25 15:52

    I've just wrote a blog post about this problem and others similar, Create one executable file for a Flask app with PyInstaller

    Basically an elegant solution is to execute the following:

    Windows

    pyinstaller -w -F --add-data "templates;templates" --add-data "static;static" app.py
    

    Linux (NOT TESTED)

    pyinstaller -w -F --add-data "templates:templates" --add-data "static:static" app.py
    

提交回复
热议问题