These are the steps to setup django on our shared servers.
=====================================================
mkdir django_projects
---------------
$ svn co
http://code.djangoproject.com/svn/django/trunk/ django_src
---------------
Edit .bash_profile to add Django to your path and python path:
---------------
export PATH=$PATH:$HOME/django_src/django/bin
export PYTHONPATH=$PYTHONPATH:$HOME/django_src:$HOME/django_projects
---------------
* Reload .bash_profile
---------------
$ source .bash_profile
---------------
Link admin_media to your media domain from the Django source code
---------------
$ ln -s $HOME/django_src/django/contrib/admin/media
$HOME/public_html/admin_media
---------------
Start a new project in django_projects
---------------
$ cd django_projects
$ django-admin.py startproject myproject
$ chmod 600 myproject/settings.py
---------------
Edit ~/django_projects/myproject/settings.py.
---------------
DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'user_django'
DATABASE_USER = 'user_django'
DATABASE_PASSWORD= '******'
TIME_ZONE = 'US/Pacific'
MEDIA_ROOT = '/home/myuser/public_html/'
MEDIA_URL =
http://media.mydomain.com/'ADMIN_MEDIA_PREFIX =
http://media.mydomain.com/admin_media/'Add django.contrib.admin to INSTALLED_APPS
---------------
Change to webroot directory for mydomain.com and download fcgi.py
---------------
$ cd ~/public_html
$ wget
http://svn.saddi.com/py-lib/trunk/fcgi.py---------------
Edit ~/public_html/dispatch.fcgi
---------------
#!/usr/bin/python
import sys
sys.path += ['/home/myuser/django_src']
sys.path += ['/home/myuser/django_projects']
from fcgi import WSGIServer
from django.core.handlers.wsgi import WSGIHandler
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
WSGIServer(WSGIHandler()).run()
---------------
Make ~/public_html/dispatch.fcgi and ~/public_html/fcgi.py executable
---------------
$ chmod +x ~/public_html/dispatch.fcgi ~/public_html/fcgi.py
---------------
Edit ~/public_html/.htaccess
---------------
RewriteEngine On
RewriteBase /
RewriteRule ^(dispatch\.fcgi/.*)$ - [L]
RewriteRule ^(.*)$ dispatch.fcgi/$1 [L]
---------------
* Initialize the DB for your project and create an admin user
---------------
$ ~/django_projects/myproject/manage.py syncdb
---------------
* Load
http://www.mydomain.com/ in a browser and you should see the "It
worked!" page.
* Edit ~/django_projects/myproject/urls.py and uncomment the admin line.
* Kill the dispatch.fcgi to reload the code
---------------
$ pkill -9 dispatch.fcgi
---------------
http://www.mydomain.com/admin/ in a browser and you should see the admin login
page.