tangyi606
tangyi606
采纳率100%
2020-08-14 10:48

apache报错:set_wakeup_fd only works in main thread(python、django环境)

新手,求指导,感谢!
本来还运行的好好的结果,今天突然就报错了。重启了服务器还是报错,详细信息:

ValueError at /index/
set_wakeup_fd only works in main thread
Request Method: GET
Request URL:    http://188.131.134.249/index/
Django Version: 3.1
Exception Type: ValueError
Exception Value:    
set_wakeup_fd only works in main thread
Exception Location: c:\gzjyroot\python\python38-64\lib\asyncio\proactor_events.py, line 632, in __init__
Python Executable:  C:\gzjyRoot\Apache24\bin\httpd.exe
Python Version: 3.8.5
Python Path:    
['C:\\gzjyRoot\\project\\firstDjango',
 'C:\\gzjyRoot\\Python\\Python38-64\\python38.zip',
 'c:\\gzjyroot\\python\\python38-64\\DLLs',
 'c:\\gzjyroot\\python\\python38-64\\lib',
 'C:\\gzjyRoot\\Apache24\\bin',
 'c:\\gzjyroot\\python\\python38-64',
 'c:\\gzjyroot\\python\\python38-64\\lib\\site-packages']
Server time:    Fri, 14 Aug 2020 02:33:36 +0000

Error during template rendering
In template C:\gzjyRoot\project\firstDjango\templates\index.html, error at line 18

set_wakeup_fd only works in main thread
8       <table border="1">
9   
10          <thead>
11          <tr>
12              <td>用户名</td>
13              <td>电话</td>
14              <td >咨询留言</td>
15              <td >提交时间</td>
16          </tr>
17          </thead>
18          {%for line in form%}
19              <tr>
20                  <td>{{line.name}}</td>


Traceback:
……

C:\gzjyRoot\project\firstDjango\firstGzjy\views.py, line 26, in index
    return render(request, 'index.html', {'form': reversed(listInfo)}) …
▼ Local vars
Variable    Value
listInfo    
Error in formatting: ValueError: set_wakeup_fd only works in main thread
request <WSGIRequest: GET '/index/'>
……
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • weixin_42146296 寻寻觅觅oO 1月前

    修改 apache配置文件 httpd.conf
    在 WSGIScriptAlias 后面添加一个参数:application-group=%{GLOBAL}
    如下:

    # 配置项目的 wsgi 路径
    WSGIScriptAlias  / F:\...path...\wsgi.py application-group=%{GLOBAL}

    点赞 1 评论 复制链接分享
  • weixin_42146296 寻寻觅觅oO 1月前

    这个问题修复了没啊

    点赞 评论 复制链接分享
  • dashicaineng 蔡能教授,网站特聘专家 8月前

为你推荐