udacity / apis Goto Github PK
View Code? Open in Web Editor NEWCode Repo for API course in Fullstack ND
Code Repo for API course in Fullstack ND
Hi, i am facing below issue.
Can someone give a track?
vagrant@vagrant:/vagrant/catalog/APIs$ ./api_server.py
from: can't read /var/mail/flask
./api_server.py: line 3: syntax error near unexpected token (' ./api_server.py: line 3:
app = Flask(name)'
While executing the FlaskTest2.py file its running on the VM but as soon as the FlaskTestEndPoint.py (end point code) is executed the Name error is thrown which return following error message:
Running Endpoint Tester....
Please enter the address of the server you want to access,
If left blank the connection will be set to 'http://localhost:5000':
Making a GET Request for /puppies...
Test 1 FAILED: Could not make GET Request to web server
('Received an unsuccessful status code of 500',)
File "/Users/sudiptomanna/fullstack/vagrant/PythonData/FlaskTest2.py", line 7, in puppiesFunction
if request.method == 'GET':
NameError: global name 'request' is not defined
Please find the files attached
FlaskTest.txt
FlaskTestEndPoint.txt
Files are transformed into .txt format to upload into GitHub.
Is there anything that needs to be done before executing the files ?
Lesson_4/11_Pale Kale Ocean Eats/Solution Code/ is missing veggie_tester.py file. The starter code director has this file.
The origin of the error is traced to line 56. Here it is:
sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that
same thread. The object was created in thread id 8628 and this is thread id 5372.
[SQL: SELECT puppy.name AS puppy_name, puppy.id AS puppy_id, puppy.description AS puppy_description
FROM puppy]
[parameters: [immutabledict({})]]
As a newbie, I find this quite cryptic and am unable to completely deduce what caused this.
Thanks,
Reece
In APIs/Lesson_3/06_Adding Features to your Mashup starter code is equivalent to solution code.
Hi,
Thank you for the kind lecture, but I felt empty.... about this quiz(Lesson_3/06_Mashup),
since the starter code already have a solution..
here is the link from discussion forum
could you please fix the starter code for this quiz?
When testing endpoints2.py
with the endpoints_tester2.py
code, it would appear that tests 2, 4, and 5 are checking for status 301
.
I could imagine two fixes:
200
for both tests 2, 4, and 5. This would then cause the solution code in endpoints_project2sol.py
to pass all tests.makeANewPuppy()
test. This would still require a change to endpoints_tester2.py
. I am not sure what the status codes for tests 4 and 5 should be.There should be tests with multiple users. Currently, one could lazily circumvent the code here.
There is a typo in:
engine = create_engine('sqlite:///restaruants.db')
Are there missing files for the Starter Code in Lesson 4/11 Pale Kale Ocean Eats? The only files provided are the template file and the tester file.
at /Lesson_4/05_Mom & Pop’s Bagel Shop/Solution/views.py
line 43 why we need to get user.
I run the solution code:
in another cmd I tried:
2. Lesson_3/06_Adding Features to your Mashup/Solution Code/tester.py
which leads to the following error message:
SQLite objects created in a thread can only be used in that same thread.The object was created in thread id -1245971648 and this is thread id -1256195264
can you reproduce this? is there a bug in the solution code? what I'm doing wrong?
ExtDeprecationWarning: Importing flask.ext.httpauth is deprecated, use flask_httpauth instead.
When i execute the bagel_test.py to test my view.py one time i get a Test 1 pass, the other times i keep getting
Test 1 FAILED: Could not make a new user
I think this is because the test doesn't check if there is an alreadythe same name has been registerd in the User database, instead it just add the User directly to the Post request.. i could solve this by adding a check to the code
if session.query(User).filter_by(username = "TinnyTim").first() is not None:
u= session.query(User).filter_by(username = "TinnyTim").one()
session.delete(u)
session.commit()
I am using python 2.7.11 and tried to run the geocode.py
script
But i get error... ValueError: No Json object could be decoded in
In this line: result = json.loads(h.request(url,'GET')[1])
Any idea?
The views.py
Starter Code version has all of the routes and methods already implemented. From the video, it would seem that this should be left to the reader to implement.
on the starter code, you left your keys in the code. better remove it :). see here https://github.com/udacity/APIs/blob/master/Lesson_3/06_Adding%20Features%20to%20your%20Mashup/Starter%20Code/findARestaurant.py
cc @lobrown @veronikabenkeser
I am getting Test Failure when running the tester.py file.
While running tester.py whatever input I give here: –
Please enter the address of the server you want to access,
If left blank the connection will be set to ‘http://localhost:5000’: /restaurants
I am getting:–
Test 1: Creating new Restaurants…
Test 1 FAILED: Could not add new restaurants
(‘Only absolute URIs are allowed. uri = /restaurants/restaurants?location=Buenos+Aires+Argentina&mealType=Sushi’,)
What urls should I try to test it ??
Test 1 FAILED: Could not make POST Request to web server
("the JSON object must be str, not 'bytes'",)
I am getting this error.
On sending the POST request from postman, it shows the desired result.
With the release of FSND 4.0, we were promised python3-support in al code.
i am always having sql thread error when i execute bagel_tester.py or any previouse testers
ProgrammingError: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 139715948619520 and this is thread id 139715939702528 [SQL: u'SELECT user.id AS user_id, user.username AS user_username, user.password_hash AS user_password_hash \nFROM user \nWHERE user.username = ?\n LIMIT ? OFFSET ?'] [parameters: [{}]] (Background on this error at: http://sqlalche.me/e/f405)
i could solve this issue by adding time.sleep(3) between each try and the other
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.