PDA

View Full Version : Django sites down -- BlueHost not helping.


NilObject
12-01-2007, 07:12 PM
I have two sites that run Django through FastCGI. Sometime last week, they stopped working and now only display the source code to my "django2.fcgi" files. Here's what I have:

.htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^(admin-media/.*)$ - [L]
RewriteRule ^(media/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(django2.fcgi)
RewriteRule ^(.*)$ django2.fcgi/$1 [L]


django2.fcgi:

#!/usr/bin/env python

import sys
sys.path += ['/home/####/django_96_src']
sys.path += ['/home/####/django_projects']
sys.path += ['/home/####/python_libs']
sys.path += ['/home/####/python_libs/bin/']
sys.path += ['/home/####/python_libs/lib/python2.3/site-packages']

from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
WSGIServer(WSGIHandler()).run()


I didn't touch my files for months leading up to this problem, so I'm fairly sure the problem is on BlueHost's end. Unfortunately, they wont respond to my tickets and the guy on the live chat told me to try again Monday because that's when the guy who supposedly handles "things like this" gets in.

So while I'm busy receiving second-tier service this weekend while not one but two of my sites are entirely down, I'm hoping maybe someone here might be able to help me find out why my sites are down.

Thanks!

NilObject
12-06-2007, 12:14 AM
Nothing? No one?

BlueHost's own support isn't helping at all. When they finally replied to my ticket, they told me to switch my PHP from 4 to 5. Uhh... I'm talking about Python here, right?

redsox9
12-06-2007, 06:06 AM
I don't have much knowledge about Python scripts but one thought might be whether or not you have FastCGI turned on or off through your cPanel.

FYI, don't go through the ticket system at BlueHost - your best bet is to use the LiveChat feature on the main BH page.

cade
12-07-2007, 03:14 PM
If you happen to be on one of the servers that was recently upgraded to Apache 2.2.5, the FastCGI handlers have changed (which would explain why you suddenly see the text of your django2.fcgi files).

You may need to explicitly define the handler for FastCGI in your .htaccess file:
AddHandler fcgid-script .fcgi

Previously, the FastCGI handler was fastcgi-script.

teamhot
01-20-2008, 03:20 AM
I had this exact problem, thank you so much for the tip!!