0

I am learning Flask.

I was able to run the Hello World tutorial as shown here

Then I tried to build the Flaskr program following the tutorial http://flask.pocoo.org/docs/tutorial/introduction/

I ran into an issue with the Flaskr program accessing the database,specifically "sqlite3.OperationalError OperationalError: unable to open database file"

so I took a break and went back to seeing if I could run my "Hello World" program.

Now when I go to the url 127.0.0.1:5000/, instead of seeing "hello world" I still see my data base error from the Flaskr program.

It seem like I need to reset the server instance or something? Please help!

pigletfly
  • 1,051
  • 1
  • 16
  • 32

2 Answers2

0

kill python task in the task-manager and then run your server

Odai Al-Ghamdi
  • 302
  • 2
  • 12
0

If you're testing or working on multiple projects at the same time, please run each one in a dedicated virtual environment and serve at a different port because by default flask serves at 127.0.0.1:5000.

Use something like this below:

if __name__ == "__main__":
app.run(host='0.0.0.0',port=8001)

You can change the port in each other project and run all of them without any problem.

Happy coding,

J.

Jalal
  • 407
  • 3
  • 5