django服务器(托管在ec2 ubuntu上,多个用户失败)

问题描述 投票:0回答:1

我正在尝试使用screen命令在aws ec2实例(ubuntu)上运行django服务器。

screen -L python3 manage.py runserver 0.0.0.0:8000

我的脚本以一种简单的通用方式工作,它可以检测POST请求,通过HttpResponse处理和响应。

我的代码在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")

[当一个用户进行交互时,突然有新用户迭代,并且检测到新的发布请求,则旧的流程将被切断。没有引发错误。

如何处理多个用户?

django ubuntu amazon-ec2 django-views gnu-screen
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.