Django - other method

=Installing django=

Create your private python
To install your private python: export HOMEDIR="" export TEMPDIR="${HOMEDIR}/temp" export PYTHON_HOME="${HOMEDIR}/python24" export PATH="${PYTHON_HOME}/bin:$PATH" source  mkdir ${TEMPDIR} cd ${TEMPDIR} url="http://peak.telecommunity.com/dist/virtual-python.py" wget ${url} python2.4 virtual-python.py --prefix ${PYTHON_HOME} --no-site-packages source  which python cd ${TEMPDIR} url=http://peak.telecommunity.com/dist/ez_setup.py wget ${url} python ez_setup.py
 * Add the following lines to your  ( .bash_profile, .zprofile or whatever )
 * Reload your  to get the updated variebles
 * make the temporary folder
 * run virtual-python.py
 * check that python command loads you private python ${PYTHON_HOME}/bin/python
 * install easy_setup by running ez_setup.py

Install prerequisites
easy_install flup
 * To use fast cgi you will need flup

easy_install mysql-python
 * To use mysql as the databse you will need mysql-python

Install django
install django version 0.95 url="http://www.djangoproject.com/download/0.95/tarball/" easy_install ${url}

=Create your first django site=

name=mysite sitedir=${HOMEDIR}/www cd ${sitedir} django-admin.py startproject ${name} import sys, os site_dir=" "
 * Decide where to install your django site and its name
 * Create the new site
 * Create django.fcgi in your www root
 * 1) ! 

sys.path += [site_dir] os.environ['DJANGO_SETTINGS_MODULE'] = ".settings" from django.core.servers.fastcgi import runfastcgi runfastcgi(["method=threaded", "daemonize=false"])
 * 1) Set the DJANGO_SETTINGS_MODULE environment variable.

chmod 755 django.fcgi
 * Change django.fcgi premissions

RewriteEngine On RewriteBase / RewriteRule ^(media/.*)$ - [L] RewriteCond %{REQUEST_URI} !(django.fcgi) RewriteRule ^(.*)$ django.fcgi/$1 [L]
 * Edit .htaccess in your www root
 * You should see now your django powered site.

Customize your site

 * Update the database settings in settings.py
 * See django tutorial for more details how to customize the site