FCGI htaccess handler

Posted by sharvey on Stack Overflow See other posts from Stack Overflow or by sharvey
Published on 2010-04-11T15:14:36Z Indexed on 2010/04/11 15:23 UTC
Read the original article Hit count: 489

Filed under:
|
|
|

I'm trying to setup django on a shared hosting provider. I followed the instructions on http://helpdesk.bluehost.com/index.php/kb/article/000531 and almost have it working.

The problem I'm facing now is that the traffic is properly routed throught the fcgi file, but the file itself shows up as plain text in the browser. If I run ./mysite.fcgi in the ssh shell, I do get the default django welcome page.

my .htaccess is:

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

and mysite.fcgi:

#!/usr/bin/python2.6
import sys, os
os.environ['DJANGO_SETTINGS_MODULE'] = "icm.settings"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

thanks.

© Stack Overflow or respective owner

Related posts about django

Related posts about fcgi