yasoob / practical-python-projects

99 stars 42 forks source link

Further clarification needed for 3.7 #9

Closed smithers closed 3 years ago

smithers commented 4 years ago

Location Within the Book

Hint: Page numbers change all the time. The best way to report an issue is by chapter and section numbers.

Description

I am at a loss re what to do with the page of code given that begins with:
1 import requests 
2
3 url = 'http://127.0.0.1:5000/'

I realize it's testing the json request, but can't tell if the code is supposed to be added to app.py, or run as a separate script?  I think it's the former, as I see no request in app.py to open up 127.0.0.1.  More instruction here would be very helpful.  Thanks.

Possible Solutions

Your full name so I can provide accurate credit within the book

yasoob commented 4 years ago

Hi @smithers

That piece of code is just there to test whether our Flask web app is working and responding the way we expect/want it to. This is a separate file and will be run independently from our app.py file. I will add more details in the book to make it clearer. If there is anything else in this section that was unclear let me know.

Thanks for bringing this up :)

yasoob commented 3 years ago

I have added some more context to this code in the book and made sure people are aware of what we are doing with it.