python - 无法导入 flup.server.fcgi

标签 python django .htaccess fastcgi flup

我正在按照 this steps 部署一个 Django 项目
我的 .htaccess 是:

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]
我的.fcgi:
#!/homeX/your_username/python27/bin/python27
import sys, os

# Add a custom Python path.
sys.path.insert(0, "/homeX/your_username/python27")
sys.path.insert(13, "/homeX/your_username/myproject")

os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
当我跑 python2.7 mysite.fcgi为了证明它有效,它让我觉得:

Can't import flup.server.fcgi


如何导入 flup.server.fcgi ?
我正在使用:Django 1.8.7 , flup 1.0.3 , python 2.7 , psycopg2postgreSQL ,所有都是使用 pip 下载的.

最佳答案

你用的是哪个版本的flup?他们似乎在 2015 年 12 月 10 日发布了一个新的开发版本,该版本作为最新的稳定版本下载,并且只有 python3。对我来说降级到 flup==1.0.3.dev-20110405解决了问题

关于python - 无法导入 flup.server.fcgi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34294614/

相关文章:

python - 如何使用 sleep 来限制写入日志的数据?

Python浮点确定性

python - 此字段无法更改 Django 验证错误

php - 如何在Wordpress中添加Google的utm_source变量?

php - .htaccess 文件中的 url 重写问题

python - 在wxPython中向wxMessageDialog box/AboutDialogInfo添加文本控制窗口

Python:评估为 'false' 的空字符串

python - Django channel : Alternative of Redis for windows machine?

python - 帮助避免 python/django 错误的工具或技术

php - 尝试将 Codeigniter Project 3.0 上传到主机时出现错误 404?