1

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:

  1. Is it possible for me to have the flask server automatically start up and open the portal page when I double-click the EXE
  2. 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 and template folders containing my HTML, CSS, and JS files, not to mention the fact that my file tree is built in a modular manner.
  3. 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.

Grace
  • 315
  • 3
  • 10
  • this may [help](https://elc.github.io/posts/executable-flask-pyinstaller/) why not host the flask server in cloud ? – sahasrara62 Oct 30 '20 at 21:27
  • @sahasrara62 I'm not hosting the flask server in the cloud because the project it is for is not worth the hosting space & cost. (minimal as it may be) – Grace Oct 30 '20 at 21:34
  • there are free services provided by heroku, you can use those, if no of call to website is not that much. i added a link , maybe that can help yu – sahasrara62 Oct 30 '20 at 21:36
  • Ahh I got the question wrong, He wants to run it locally on a computer. – Abhishek Rai Oct 30 '20 at 21:38
  • @AbrarAhmed Well, yes... `I'm attempting to build an application that runs locally on a user's computer.` Thank you for the site though, I'm going to investigate it, it's just not incredibly useful for my particular issue. – Grace Oct 30 '20 at 21:40
  • @FinneganMcCarthy Beyond my scope of knowledge :) – Abhishek Rai Oct 30 '20 at 21:42

0 Answers0