HostMonster Host installed on Python2.5

1. To install Python 2.5
Although django in python 2.3 and above to run, but most recommend version 2.5, at? hostmonster hosts are provided on 2.3, so you may want to install python 2.5 to personal directory. The basic installation steps are to download the appropriate installation www.python.org version. If you want to install from source code, required landing SSH then follow these steps:

1. Download the source code using wget
2. Tar zxvf python-VERSION.tar.gz
3. Cd python-VERSION
4.. / Configure-prefix = $ HOME
5. Make
6. Make install

If the lack of software installed, please follow the prompts to install.
2. Install Django
The latest official version of django 1.0, this example is installed, follow these steps:

1. Wget http://www.djangoproject.com/download/1.0/tarball/
2. Tar zxvf Django-1.0.tar.gz
3. Cd Django-1.0
4. Export PATH = $ HOME / bin: $ PATH
5. Python setup.py install

3. Setting the path
Edit ". Bash_profile" files, settings, PATH and PYTHONPATH, so that procedures can be run right:
export PATH = $ HOME / bin: $ HOME/lib/python2.5/site-packages/django/bin: $ PATH
export PYTHONPATH = $ PYTHONPATH: $ HOME / django / django_projects
Then reload. Bash_profile, so that the new configuration to take effect: source ~ /. Bash_profile, set up after the good path, then, is to create mysql database and account information, etc., in the cPanel to create a django project for mysql data, database users, and recorded for the project settings.
4. Create Project directory

1. Cd ~
2. Mkdir django_projects
3. Mkdir django_templates
4. Cd django_projects
5. Django-admin.py startproject mysite
6. Chmod 600 mysite / settings.py

The last sentence to set up the settings.py file permissions to prevent other users to see the U.S. database, users, passwords and other important information. Settings.py modify the contents of the database settings, time zone, such as template directory information.
5. Configure FastCGI
This step is very important! First of all, at cPanel's "Apache Handlers" add the following information:
Processor Name: fcgid-script
File extension:. Fcgi
And, you want to add in the django support web directory, the installation fcgi.py, django.cfgi, and add URL rewrite rules.
wget http://svn.saddi.com/py-lib/trunk/fcgi.py
chmod 755 fcgi.py
Download the file and set permissions, if the file can not download, but also can use the link http://www.frankdu.com/download/fcgi.py

In the same directory, create a file django.fcgi, the contents of the paper is as follows:

#! ~ / bin / python
import sys, os
sys.path.insert (0, "/ home / your-user-name / django / django_projects")
from fcgi import WSGIServer
os.environ [ 'DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
from django.core.handlers.wsgi import WSGIHandler
WSGIServer (WSGIHandler ()). Run ()

Bearing in mind that the above "your-user-name" you need to be changed at hostmonster user name. "Django_projects" We are set up the release of the project directory. No. 5 line of "mysite" are generated Django project's name. This must correspond to some!

To modify the implementation of same permissions:
chmod 755 django.fcgi

6. Rewrite Rule Configuration
This on the simple ! And above django.fcgi document in the same directory, set up. Htaccess files (Do not forget the points), which reads as follows

RewriteEngine On
RewriteBase /
RewriteRule ^ (media /.*)$ - [L]
RewriteCond% (REQUEST_URI)! (Django.fcgi)
RewriteRule ^(.*)$ django.fcgi / $ 1 [L]

Well, to get here! Can write some test scripts, running click.