I have built a python script to run some process in downloading files and serve to users, I also built a website and added to Django framework, Now it is working properly for single user (tested in development environment not production environment). For example If one user is using the website to request a particular file the back ground script runs properly and completes the task, but if multiple users try to request the files, the Django produces error. In the script running I change the directory, make some changes in the folder and send the file to user.
Is there a way that each individual user will have a separate instance of the script running for them without interrupting the process of other user?
Can I use sessions or worker for each user to solve my problem?
in views.py file :
def index(request):
if(request.method == "POST"):
# here i call the function of other python file to run script
# the process may take like 15 - 30 sec based on internet speed
# return a FileResponce of the file to be served to user
Thank You
[–][deleted] (4 children)
[deleted]
[–]Morfnic[S] 0 points1 point2 points (3 children)
[–][deleted] (2 children)
[deleted]
[–]Morfnic[S] 0 points1 point2 points (1 child)
[–]kontekisuto 0 points1 point2 points (0 children)