本人开发使用的是apache2.4,python3.6和django,在配置Apache的时候,内外网同时访问就会报错,
只能有一方访问,
Traceback (most recent call last):\r, referer: http://***/***.html
File "c:\\programdata\\anaconda3\\lib\\site-packages\\django\\core\\handlers\\exception.py", line 34, in inner\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] response = get_response(request)\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] [ File "c:\\programdata\\anaconda3\\lib\\site-packages\\django\\utils\\deprecation.py", line 90, in __call__\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] response = self.process_request(request)\r, referer: http://***/***.html
[wsgi:error] File "c:\\programdata\\anaconda3\\lib\\site-packages\\django\\middleware\\common.py", line 52, in process_request\r, referer: http://***/***.html
[wsgi:error] if self.should_redirect_with_slash(request):\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] File "c:\\programdata\\anaconda3\\lib\\site-packages\\django\\middleware\\common.py", line 70, in should_redirect_with_slash\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] not is_valid_path(request.path_info, urlconf) and\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] File "c:\\programdata\\anaconda3\\lib\\site-packages\\django\\urls\\base.py", line 157, in is_valid_path\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] resolve(path, urlconf)\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] File "c:\\programdata\\anaconda3\\lib\\site-packages\\django\\urls\\base.py", line 24, in resolve\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] File "c:\\programdata\\anaconda3\\lib\\site-packages\\django\\utils\\functional.py", line 37, in __get__\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] res = instance.__dict__[self.name] = self.func(instance)\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] File "c:\\programdata\\anaconda3\\lib\\site-packages\\django\\urls\\resolvers.py", line 526, in urlconf_module\r, referer: http://***/***.html
........................................
[wsgi:error] [pid 112308:tid 1052 from . import core\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] File "c:\\programdata\\anaconda3\\lib\\site-packages\\numpy\\core\\__init__.py", line 40, in \r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] from . import multiarray\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] File "c:\\programdata\\anaconda3\\lib\\site-packages\\numpy\\core\\multiarray.py", line 12, in \r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] from . import overrides\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] File "c:\\programdata\\anaconda3\\lib\\site-packages\\numpy\\core\\overrides.py", line 46, in \r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] """)\r, referer: http://***/***.html
[wsgi:error] [pid 112308:tid 1052] RuntimeError: implement_array_function method already has a docstring, referer: http://***/***.html
在Apache2.4的目录找到conf目录下找到httpd.conf
在文件mog_wsgi j添加 一句话:WSGIApplicationGroup %{GLOBAL}
#添加mod_wsgi.so模块,这三行是上面命令行中显示出来的
LoadFile "c:/******/python36.dll"
LoadModule wsgi_module "c:/*****/mod_wsgi/server/mod_wsgi.cp36-win_amd64.pyd"
WSGIPythonHome "c:/*****/anaconda3"
//加入这句话,可以多接口访问
WSGIApplicationGroup %{GLOBAL}
如此问题解决!
参考链接,runtime error