My hosting company uses FCGI for Django deployments, which I know is not optimal (and will be removed in Django 1.9). I would still like to be able to deploy LFS with them if at all possible. I have been able to get a standard Django deployment to work on their shared hosting
. Here are their Django installation instructions:
However, every time I try to get LFS working, I get these errors:
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Before I can do step 6 of the LFS installation instructions (syncing the database) I run python application.fcgi to see if it's working, and it never does.
My virtualenv is called devstore, and I am trying to get it installed on a subdomain called dev-store.
Here is my .htaccess file:
AddHandler fcgid-script .fcgi
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(adminmedia/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(cgi-bin/application.fcgi)
RewriteRule ^(.*)$ cgi-bin/application.fcgi/$1 [L]
And here is my application.fcgi file:
#!/home/tentsand/devstore/bin/python
# Set up the virtual environment:
import os, sys
os.environ.setdefault('PATH', '/bin:/usr/bin')
os.environ['PATH'] = '/home/tentsand/devstore/bin:' + os.environ['PATH']
os.environ['VIRTUAL_ENV'] = '/home/tentsand/devstore/bin'
os.environ['PYTHON_EGG_CACHE'] = '/home/tentsand/devstore/bin'
os.chdir('/home/tentsand/public_html/dev-store/lfs-installer')
# Add a custom Python path.
sys.path.insert(0, "/home/tentsand/public_html/dev-store/lfs-installer")
# Set the DJANGO_SETTINGS_MODULE environment variable to the file in the
# application directory with the db settings etc.
os.environ['DJANGO_SETTINGS_MODULE'] = "lfs_project.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
Can anybody see what I'm doing wrong here? I have tried changing my paths to a few different things, and this gets me the closest to working. Anything else returns a "lfs_project.settings not found" error.
Thanks!