abw333
abw333

Reputation: 5951

Flask not reacting to code changes

I am new to Flask and am implementing a tiny application. I successfully got it to display "Hello World" when visiting a certain web page, but I cannot change it to say "Hello World Again," even if I change the code. Why is it still running the old code and how can I get it to run the new code? Thanks.

Upvotes: 3

Views: 3856

Answers (1)

ThiefMaster
ThiefMaster

Reputation: 318518

You need to run the app in debug mode:

app.debug = True
app.run()

or

app.run(debug=True)

But remember, only do that in your development environment:

Even though the interactive debugger does not work in forking environments (which makes it nearly impossible to use on production servers), it still allows the execution of arbitrary code. This makes it a major security risk and therefore it must never be used on production machines.

You could also use use_reloader=True without enabling debug mode, but that's not a good idea since you really want the debugger during development.

Upvotes: 10

Related Questions