DEV Community

Discussion on: Flask Rest API -Part:1- Using MongoDB with Flask

Collapse
 
therealibukun profile image
the-real-ibukun

Really helpful,
Some section of the code is omitted here, saved by the complete code on github though.
Thanks again.

Collapse
 
paurakhsharma profile image
Paurakh Sharma Humagain

Thank you so much ❤️
Can you point me what is missing so that I can add it here.

Collapse
 
therealibukun profile image
the-real-ibukun • Edited

Missing function definition add_movie()

@app.route('/movies', methods=['POST'])
body = request.get_json()
movie = Movie(**body).save()
id = movie.id
return {'id': str(id)}, 200

.movie not required

from database.models.movie import Movie

Apart from that it's ready to run 😃