I'm attempting to build an application that runs locally on a user's computer. It takes inputs and displays information, so I thought a nice way to make it work would be to have a Flask server that handles web forms, etc, to gather user input, and to display database contents in tables.
The service works when I run the Flask development server, and everything is fine and dandy, but I want to compile the entire project into a single executable file.
My questions are as follows:
- Is it possible for me to have the flask server automatically start up and open the portal page when I double-click the EXE
- Assuming this is a feasible concept, how would I go about compiling the exe? A brief look through the pyinstaller documentation does not tell me how I would compile a folder (which in this case would be more of a Python package), which would be a necessary pre-requisite considering that Flask has
static
andtemplate
folders containing my HTML, CSS, and JS files, not to mention the fact that my file tree is built in a modular manner. - Am I approaching this the wrong way? Would it be better to build a "launcher" application that runs Flask as a Windows service (vis a vis this question) instead of attempting to have an all-in-one EXE?
For reference, my file tree looks something like this:
Application
|_static
|_templates
|_\templates\errors
|_\templates\forms
|_errors
|_database
|_\database\connections
|_\database\iohandlers
|_"__init__.py"
|_"app.py"
While doing research on this, I came across this answer but as my situation doesn't mesh with the model that the OP had laid out, I thought it would be pertinent and useful to ask another question.