U
U
Username2021-10-24 21:22:58
Flask
Username, 2021-10-24 21:22:58

How to write data to the database with a request from an external API?

I write right away that I just started to understand Flask. I am writing a web application with a database that will download data from the IMDB API.
I understand how to get json from api. Let the application be not universal. We are looking for directors and their films.
The user case is as follows:
1. I enter the name of the director
2. I press the "search" button
3. A check is performed, if it is not found, it will display an error, otherwise
4. Download all the films of this director to the database
5. Report that "OK"
6. On a separate page list of directors with the "Show movies" button

1. Do I need to download json with the necessary data first and only then read it and write the data to the database or is there another way?
2. Give, please, an example of code, everywhere only how to write data from the forms that you enter yourself, but I need to search for data from an external api, then write it, then read it from the database. I'm dumb >_< and I didn't find anything like it..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
U
Username, 2021-10-25
@wizkey

Found an example https://www.section.io/engineering-education/integ...
https://github.com/geoffrey45/flask-request

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question