I am attempting to get Django running without luck. It is to be setup in a subdomain rather than my public_html directory since I am just testing it out at the moment. I've tried putting all of the fcgi and py files in various locations since nothing has been functional.
My directory structure currently looks like this:
/home/username/django_projects/myproject
manage.py
settings.py
urls.py
__init__.py
/home/username/django_src
/home/username/public_html/django
.htaccess
dispatch.fcgi
fcgi.py
hello.fcgi
django_templates/
media/
This is what is in my dispatch.fcgi file:
#!/usr/bin/python2
import sys, os
sys.path += ['/home/username/django_src']
sys.path += ['/home/username/django_projects']
from fcgi import WSGIServer
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
from django.core.handlers.wsgi import WSGIHandler
WSGIServer(WSGIHandler()).run()
This is the .htaccess file:
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(dispatch.fcgi)
RewriteRule ^(.*)$ dispatch.fcgi/$1 [QSA,L]
I have successfully imported the django tables into mysql. The myproject settings file has the proper db connection information. I am not getting any error messages in my cPanel error log so that is why it has gotten difficult to debug.
At one point I had the debug feature of Django working but it would tell me something about ^admin/ not being found yet I had added that darn thing all over the place and it was uncommented in the urls.py file and I added 'django.contrib.admin', to the installed apps portion of the settings.py file. I do not know why it stopped showing the debug and started showing the plain text of dispatch.fcgi.
Thank you,
Sherri