PDA

View Full Version : Installing Django under mod_python


Phoop
12th June 2008, 23:01
I want to install mod_python under our ISPConfig. Surely this is not a problem, but I have a question regarding the configuring.

As ISPConfig does not support mod_python out of the box, I have to edit the vhosts file myself to add the nessecary lines. This is not a problem at all.

My question is: When I add those lines, and after a week or two want to edit that VHost under ISPConfig, will those lines be deleted or preserved?

till
13th June 2008, 12:33
Do not edit the vhost, add the lines in the apache directives field of the website instead.

Phoop
13th June 2008, 13:04
Totally forget about that part.

Thanks!

dayjahone
17th June 2008, 20:42
How do you do that? I'm interested in installing django as well. Thanks.

Phoop
18th June 2008, 12:20
Yes, I managed to install Django. Since Im running the latest Ubuntu LTS I just installed mod_python for Apache2 and exported the SVN Trunk to my site-packages.

After that I uploaded my django project to the web folder.

Last step, adjust and paste this into the Apache Directives in the ISPConfig configuration of the site:

<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE intranet.settings
PythonDebug On
PythonPath "['/var/www/web18/web'] + sys.path"
</Location>

dayjahone
19th June 2008, 17:52
I'm actually running Suse 9.2. Does anyone know if I can install it simply with apt-get install?...apt-get install mod_python?

falko
20th June 2008, 14:20
apt-get usually is for Debian-based distributions. You should try yast instead.

dayjahone
4th December 2008, 16:21
I installed the following packages:

sudo apt-get install apache2 libapache2-mod-python
sudo apt-get install mysql-server python-mysqldb

cd ~/

svn co http://code.djangoproject.com/svn/django/trunk/ django_src

ln -s `pwd`/django_src/django /usr/lib/python2.5/site-packages/django

sudo cp ~/django_src/django/bin/django-admin.py /usr/local/bin

cd ~/

mkdir django_projects

mkdir django_templates

mkdir media

cd /var/www

sudo ln -s ~/media media

sudo ln -s ~/django_src/django/contrib/admin/media admin_media

Can I now upload my project to the /home/user/django_projects and the app to /usr/lib/python2.5/site-packages/? Then add the directive?