2

I am running Flask Shell as a way to interact with SQLAlchemy. However, I notice that whenever I run Flask Shell in my app directory, it only references the code that was present at the time it was run. This means that if I detect an error and update the code, I need to close my command terminal, re-navigate to my Flask app directory, and run Flask Shell again.

Is there any way for me either access my Flask app directly from the Python Shell, or to have Flask Shell automatically update if there is a change in the code? It seems incredibly inefficient to do it the way I have been doing it. The way I am currently running Flask Shell is that I am navigating to my Flask app directory in the command terminal and then running the "flask shell" command, every time I update my code.

To be clear, this is different from running a Flask app on localhost. That does update once the code is changed. Flask Shell, however, does not, and is specifically being used in this case to interact with SQLAlchemy.

GMQuery
  • 21
  • 3

1 Answers1

-2

Turn on debug mode/development and it will auto refresh the server when you make changes to your code

Clint
  • 167
  • 2
  • 11