Thanks for the post, Flavio. Looks very similar to the post on Dreamhost
Anywho, you might want to change the part that talks about making a folder named 'django.mydomain.com' because it seems that the subdomains are created thru the control panel and are placed in the $HOME/public_html directory.
So, I got this working last night after looking at this post, one from site5, and the fastcgi docs from django's website. I ended up using a config like the one in this post, however, not like the django docs.
I have the django svn tree in $HOME/django_src, so under that are the folders django, docs, examples, etc.
I have $HOME/djangoapps as my folder for my django apps. In there I have my first project, called 'myapps'.
I setup my .bash_profile like in the post, and sourced it, then created my project.
Code:
cd $HOME/djangoapps
django-admin.py startproject myapps
Then thru the mysql admin from the control panel, I created a new database, username_django, with a user, and entered that into my myapps/settings.py file. I also changed the perms like in the above post to 600 on the settings.py file.
I already had a subdomain created thru the control panel, and that folder lives in $HOME/public_html/subdomain.
I downloaded fcgi.py from the above site, and also flup, as per the django docs. Not sure if I really needed that, but I had downloaded it to try setting up django as per their fastcgi docs. Let's place them in our django_src folder, since we will be adding that to the sys.path for python anyways.
So now, in my $HOME/public_html/subdomain folder I created two files, django.fcgi and .htaccess.
Django.fcgi --
Code:
#!/usr/bin/env python
import sys, os
sys.path.insert(0,"/home/username/django_src")
sys.path.insert(0,"/home/username/djangoapps")
from fcgi import WSGIServer
os.environ['DJANGO_SETTINGS_MODULE'] = 'myapps.settings'
from django.core.handlers.wsgi import WSGIHandler
WSGIServer(WSGIHandler()).run()
.htaccess --
Code:
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(django.fcgi)
RewriteRule ^(.*)$ django.fcgi/$1 [L]
Before I run anything, I made sure my settings.py file in $HOME/djangoapps/myapps was setup with the correct database info, time zone, installed apps, template directory. I had to add 'django.contrib.admin' to the list of installed apps in order to see the admin interface. When doing that, you also need to edit the urls.py file and uncomment the admin line. This is documented on django's website.
I also linked in the media directory to my $HOME/public_html/subdomain directory like in the above post.
Once that was all setup, It worked! I was able to go to subdomain.domain.com/admin/ and login as the superuser I had created and view the nice admin interface.
Thanks again!