DEV Community

Discussion on: Flask Rest API -Part:2- Better Structure with Blueprint and Flask-restful

Collapse
 
julsperez profile image
Julio Pérez Hernández

Hello, thank you for your knowledge.
I have followed every step in this tutorial and I found great but a little bit confusing.
First of all, when I try to get the movies using the endpoint '/api/movies', the result is only '[]'. I think is because we never populate the database, isn't it?
How can I get the list of movies that we use in the part 0 and 1?

Also, I guess that is missing the port in app.py

app.config['MONGODB_SETTINGS'] = {
'host': 'mongodb://localhost:27017/movie_bag'
}

In other hand, I suppose that a requirement to this series is have installed mongodb locally.

When you show the code that we need to delete (red) and add (green) you didn't show the entire code so I had to go to your repository and check the complete changes.

Thank you in advance!

Collapse
 
paurakhsharma profile image
Paurakh Sharma Humagain

Thank you for the comments.
The result is only [] probably because you do not have any movies in the DB.

By default, the port is 27017 so I didn't include it. (But I should have mentioned in the post) - Thank you for bringing this up.

I mentioned in the previous part of the series to install MongoDB with respective links for each OS.

Yeah about that red and green part. If you followed along with the tutorial you don't have to touch any other codes that are not indicated by the green or red color. If you are just starting with this part you have to first clone the project from the first article GitHub link.

But I should include it at the beginning of each part as well.

Thank you for all the suggestions. These suggestions make me do better for my next articles.

Happy Coding 😊