Flask - render template asynchronously

前端 未结 1 539
失恋的感觉
失恋的感觉 2021-01-26 17:44

I\'m making a Flask app and I was wondering if I could render a template for a route, but redirect the user after a function is complete. Currently using Python 2.7 Here is my e

相关标签:
1条回答
  • 2021-01-26 18:18

    This sounds more like a client sided thing to me? Do you want something like a loading bar?

    You could provide an ajax route which initiates heavy workload on the server side - while the client does show some progress. Once the workload finished you render a template which than gets loaded via ajax.

    For asycn workload you could look into Celery, which is a great library for that. It even can do work on a seperate server...

    More sources Integration in Flask

    0 讨论(0)
提交回复
热议问题