Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't import flup.server.fcgi

I'm deploying a Django project following this steps

my .htaccess is:

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]

my .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")

When I run python2.7 mysite.fcgi to prove it is working, it throws me:

Can't import flup.server.fcgi

How can I import flup.server.fcgi?

I'm using: Django 1.8.7, flup 1.0.3, python 2.7, psycopg2 for postgreSQL, and all was download using pip.

like image 372
Andres Hernandez Avatar asked Feb 09 '23 07:02

Andres Hernandez


1 Answers

Which version of flup do you use ? It seems they released a new dev version on 10.12.2015 which is downloaded as the latest stable version and is python3 only. For me downgrading to flup==1.0.3.dev-20110405 fixed the problem

like image 177
snejy Avatar answered Feb 12 '23 12:02

snejy