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
if getattr(sys, 'frozen', False):
template_folder = os.path.join(sys.executable, '..','templates')
static_folder = os.path.join(sys.executable, '..','static')
app = Flask(__name__, template_folder = template_folder,\
static_folder = static_folder)
copy this code and paste in your file. now pyinstaller looks for static and template folder in your dist directory. Now copy and paste static and template folder in your dist folder. it will works