I am currently struggling to set up Django on a MediaTemple dv 3.0 server. I failed to find any resources on Google that worked for me, so I combed through the private MediaTemple user forums. I found the following forum posting to be useful, so I’m re-posting it here so that it’s publicly accessible via search engines:
Thanks for the help, I got it working. For anyone’s future reference here are the steps I took to make this work:
Using:
Python2.4
MySqlDb 1.2.1_p2
Django off the svn trunkDownload and compile and install mysqldb
Edit your vhost.conf file just as leland said, as root in the conf dir of vhost:
Code:
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath “['/var/www/vhosts/your-domain.com/django-projects'] + sys.path”
SetEnv DJANGO_SETTINGS_MODULE your-project-name.settings
PythonDebug Off
PythonInterpreter UniqueID
SetHandler None
SetHandler None
Create your django-projects directory and set the owner:group
Code:
chown ftpusername:psaserv django-templates django-projects
I symlinked my django-admin.py to /usr/local/bin/django-admin.py
You will need to restart apache and, this was one that puzzled me for a bit…I had to resave my domain settings in plesk to get it to pick up the vhost.conf file.
(A good reference for this: http://groups.google.com.tr/group/djang … 4de833d9c2)
Once you have done that create a project and make sure the vhost is setup correctly…
To test I just setup a basic page like in the django book:
http://www.djangobook.com/en/1.0/chapter03/
- joshm
The Conversation {2 comments}
This should work for you in your vhost.conf:
Alias /devel “/var/www/vhosts//django-projects/”
<Directory /var/www/vhosts/
Options Indexes FollowSymLinks MultiViews
<Directory /var/www/vhosts//django-projects/>
Options Indexes FollowSymLinks MultiViews
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonOption django.root “/var/www/vhosts//django-projects”
PythonPath “['/var/www/vhosts//django-projects'] + sys.path”
SetEnv DJANGO_SETTINGS_MODULE .settings
PythonDebug On
Order allow,deny
Allow from all
Looks like the comment engine stripped a bunch of the configuration tags. Give me an e-mail and I’ll send you the code for vhost.conf on MT.
Leave Your Own Comment
You can follow any responses to this entry via its RSS comments feed. You can also leave a trackback if the inclination is there.