Z
Z
zilevsky2022-03-02 22:57:49
Python
zilevsky, 2022-03-02 22:57:49

How to run script by Execute via API?

There is a route to run the data parsing script

@app.get("/upload/")
async def upload():
    """ Загружаем список данных """
    return Parser


The Parser class has a script for connecting to the site, parsing it, and writing the received data to the database.

Through the request execution interface writes "Internal Server Error"
At the same time, when the server is restarted, the script automatically works.

I can not figure out how to make the script run exactly on request, and not when the server is restarted.

621fcc38ea312832496562.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question