DEV Community

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

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 😃