background-process

How to run function in background in Django view

How to run function in background in Django view Question: I have Django project with one view. When I refresh page I want to call some function which is very complicated and take same time to execute. How and what is the best way to do it in backround? import time import psycopg2 from django.http …

Total answers: 2

how to make the sqlalchemy async session(Async Session) generator as class-base?

how to make the sqlalchemy async session(Async Session) generator as class-base? Question: I have the fast API application and run schedule task in a background thread as a startup event in fast API. so when I use the SQlAlchemy async session in route scope like: session: AsyncSession=Depends(instance_manger.db_instance.get_db_session) it’s ok and runs as correct , but …

Total answers: 1

How to constantly run Python script in the background on Windows?

How to constantly run Python script in the background on Windows? Question: I have created a script that moves files from one folder to another. But since the original folder is the Downloads folder I need it to always run in the background. I also have a standard Batch file that looks something like this: …

Total answers: 5

Running Python Script as a Windows background process

Running Python Script as a Windows background process Question: I have been trying to code a python script which reads data from a serial port. It worked well from the command line but I need it to run as a background process without any command line interface. The script has a while loop which reads …

Total answers: 1

Simple approach to launching background task in Django

Simple approach to launching background task in Django Question: I have a Django website, and one page has a button (or link) that when clicked will launch a somewhat long running task. Obviously I want to launch this task as a background task and immediately return a result to the user. I want to implement …

Total answers: 3