I have a web application based on Flask, when I run it from the script python my_script.py --web
, it works well.
However after I package it using PyInstaller with pyinstaller my_script.spec
and run it with .\my_script.exe --web
, everything seems to work fine according to the log and the web application is opened at a port (checked with netstat
)
But in browser it gives "404 Not Found"
I solved the problem. The app requires some part of the code in my frontend/dist
folder. To run Flask application, we have to copy the code needed to the same path of the executable, which is copy frontend
to dist\my_script