Quantcast
Channel: django server (hosted on ec2 ubuntu) failing for multiple users - Stack Overflow
Viewing all articles
Browse latest Browse all 2

django server (hosted on ec2 ubuntu) failing for multiple users

$
0
0

I am trying to run django server on aws ec2 instance (ubuntu) using screen command.

screen -L python3 manage.py runserver 0.0.0.0:8000

My script works in simple common way that it detects a POST request, processes and responds via HttpResponse.

My code looks somewhat like this in views.py.

def myResponse(arg):
   """
   processing here
   """
   #this function gets executed
   #code below does not get executed, it gets cut off when, new request comes
   HttpResponse("responseString")


def index(request):
    if (request.method == "POST"):
        """
        process here
        """
        #this function gets triggered, whenever post request is detected
        myResponse(arg) 
        HttpResponse("anotheresponseString")

When one user is interacting, and suddenly new user iteracts and new post request is detected, older flow get cut off. No error is thrown.

How do I handle multiple users ?


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images