0
我得到这个错误,在Windows 7家庭主版64位环境。 我曾尝试过许多不同的方式,如apache文档中所述。 在httpd.conf中我有以下 环境Python 3.4,apache 2.4.25 mod_wsgi py25 vc10 64位。此外,我试图通过CGI运行Python代码 ,它工作正常。mod_wsgi windows 7 64位安装问题
LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonEggs /apache2423/Apache24/htdocs
WSGIScriptAlias /wsgi /apache2423/Apache24/htdocs/wsgi.py
WSGIPythonPath /Python34
<Directory /apache2423/Apache24/htdocs/>
<Files wsgi.py>
Require all granted
</Files>
</Directory>
的代码是:
#!/Python34/python
import os
import subprocess
os.environ['PYTHON_EGG_CACHE'] = '/Apache245/Apache24/htdocs'
def application(environ, start_response):
status = '200 OK'
output = b'<html> ... Hello World of Django ...</html>'
response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
什么是错误?你在哪里看到这个错误? Apache错误日志中有哪些消息? –
我曾尝试运行此代码。 #!/ Python34 /蟒 进口OS 进口子 os.environ [ 'PYTHON_EGG_CACHE'] = '/ Apache245/Apache24/htdocs中' DEF应用(ENVIRON,start_response): 状态= '200 OK' 输出= b' ... Django的Hello World ...' response_headers = [('Content-type','text/plain'), ('Content-Length',str(len(output) ))] start_response(status,response_headers) return [output] – waldron
那仍然没有回答问题是什么,在哪里看到任何错误等。有关错误的详细信息是必需的。没有细节就无法猜测。 –