I am trying to fetch the data for 1 id and I am getting Nonetye object in return.
@app.route('/api/dd/<id>',methods=['GET','PUT','DELETE'])
def api_each_bmat(id):
if request.method == "GET":
music_obj = music.objects(id=id).first()
error
[2021-08-04 15:10:35,454] ERROR in app: Exception on /api/bmat/"T0350190010" [GET]
Traceback (most recent call last):
File "C:\Users\rishi\anaconda3\lib\site-packages\flask\app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\rishi\anaconda3\lib\site-packages\flask\app.py", line 1953, in full_dispatch_request
return self.finalize_request(rv)
File "C:\Users\rishi\anaconda3\lib\site-packages\flask\app.py", line 1968, in finalize_request
response = self.make_response(rv)
File "C:\Users\rishi\anaconda3\lib\site-packages\flask\app.py", line 2097, in make_response
raise TypeError(
TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.
127.0.0.1 - - [04/Aug/2021 15:10:35] "GET /api/bmat/%22T0350190010%22 HTTP/1.1" 500 -