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

标签 django ubuntu amazon-ec2 django-views gnu-screen

我正在尝试使用 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 服务器(托管在 ec2 ubuntu 上)对多个用户失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58542187/

相关文章:

python - 在 Django Rest Framework 中测试时获取路由器 url 名称

python - 导入数字 : No module named Numeric in F2PY 失败

linux - Ubuntu 命令日志

amazon-web-services - Amazon AWS spot 实例比为 24x365 使用预留便宜

amazon-web-services - AWS EC2 - 尝试上传新文件时 FTP 返回错误 451

Django选择具有特定列的查询

python - Python/Django Web 应用程序中数据库访问查询的性能优化

c++ - 在选择项目时调用 clear() 时 QListWidget 会导致崩溃

linux - 在 EC2 linux 实例启动时启动程序

python - Django - 引发异常时不会发生回滚