D
D
Drovosek012018-12-17 23:20:01
Python
Drovosek01, 2018-12-17 23:20:01

How to stop a Flask application?

There is a test.py file with the code:

from flask import Flask

app = Flask(__name__)


@app.route('/')
def home():
  return 'hello, World'

# if __name__ == '__main__':
# 	app.run()

app.run()

Run python test.py in cmd
Moved to 127.0.0.1:5000
Everything is fine, hello, World is displayed
In cmd, I pressed Ctrl+C
Updated http://127.0.0.1:5000, but it's still "hello, World"
How to stop this execution so that when you go to 127.0.0.1:5000 , what you set in flask is not displayed?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Drovosek01, 2018-12-18
@Drovosek01

Looks like I figured out what the problem was.
I first launched this file with the code for execution in Sublime Text (Ctrl + B), then closed Sublime Text and launched the file via cmd.
Then I pressed Ctrl + C in cmd, but everything continued to work on localhost.
Looks like Sublime somehow cached everything....
Rebooted the computer, started with cmd and everything was fine.

V
Vladislav Lyskov, 2018-12-17
@Vlatqa

ctrz+z

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question