Solved: Unfortunately I wasn't able to solve the problem but I started over and followed the Django + FastCGI guide on the "A Small Orange" wiki and everything is working as expected.
I am trying to setup Django with FCGI on Apache. The web hosting plan that I am using is A Small Orange's shared hosting plan.
Django is installed, working and is able to create database tables when I run the syncdb command. If I run manage.py runserver
and then use lynx to navigate to localhost:8080
django will correctly display. However, It is not possible to view django over the internet as the page displays a 500 internal server error.
I have the flup python package installed and am using python version 2.6.
The following is the contents of my .htaccess file that is situated in /public_html/
:
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(admin_media/.*)$ - [L]
RewriteRule ^(dispatch\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]
The following is the contents of my dispatch.fcgi file that is also located in /public_html
:
#!/usr/local/lib/python2.6
import sys
import os
os.chdir('/home/thegamer/django/projects/thegamer')
sys.path += ['/home/thegamer/django/django']
sys.path += ['/home/thegamer/django/projects']
from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'thegamer.settings'
WSGIServer(WSGIHandler()).run()