Thursday, September 30, 2021

Python Anywhere: Async work in Web Apps or – Have Your Cake and Eat It Too

This post is intended for users who begin their adventure with web applications. You’ll find below how to structure a web app that relies on heavy processing of the input data – processing that takes so long that you can’t do it inside a request handler with a five-minute timeout, or at least so long that you don’t want to risk slowing down your website by doing it inside the website’s own code. You want it to happen in the background. You’ll see an example implementing some hints from the “Async work in Web apps” help page, which involve writing a jQuery script polling simple API endpoint communicating with a database updated by an external script (so there will be some sqlalchemy stuff too).



from Planet Python
via read more

No comments:

Post a Comment

TestDriven.io: Working with Static and Media Files in Django

This article looks at how to work with static and media files in a Django project, locally and in production. from Planet Python via read...