Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Django函数reverse()在apache/mod_wsgi下导致MemoryError_Python_Django_Centos - Fatal编程技术网

Python Django函数reverse()在apache/mod_wsgi下导致MemoryError

Python Django函数reverse()在apache/mod_wsgi下导致MemoryError,python,django,centos,Python,Django,Centos,Django函数reverse()导致MemoryError下面是实际视图: from django.http import HttpResponse from django.core.urlresolvers import reverse def index(request): return HttpResponse(reverse('main-page')) #display the link of main-page 只有在apache/mod_wsgi下运行时才会发生此错误。我正

Django函数reverse()导致MemoryError下面是实际视图:

from django.http import HttpResponse
from django.core.urlresolvers import reverse

def index(request):
  return HttpResponse(reverse('main-page')) #display the link of main-page
只有在apache/mod_wsgi下运行时才会发生此错误。我正在使用

Apache/2.2.15 
mod_wsgi/3.5 
Python/2.7.7 
Django/1.5.8
OS/CentOS 6.5

附加信息:只有在我们的在线服务器中部署时才会发生此错误。在本地开发服务器中运行时没有出现错误。

这感觉像是内存错误,就像
主页
regex被混淆一样。什么是您的
url.py
?在manage.py runserver下运行的url(r'^$','apps.intent.base.views.base.index',name='main-page')很好。但只有在使用apache/mod_wsgi时才会出现这种情况。我唯一一次看到mod_wsgi使用中出现一个奇怪的内存错误是由于一些SELinux问题。因此,请尝试暂时禁用SELinux扩展。这里有一个例子说明了它会在哪里引起问题。是的!解决此问题请在上设置电子书httpd_tmp_exec