- OpenId is not SSO
- Two steps installing Goolge App Engine (GAE) in Ubuntu Jaunty
- Duplicate a website like Teleport on Ubuntu Jaunty Linux
- Error with lxml on Debian Lenny
- Skunkweb - it’s alive
- How to clear DNS cache in Mac (Tiger, Leopard, Snow Leopard)
- Godaddy Promotion Code
- How to delete all .svn folders recursively
Django on Debian Lenny (mod_python + apache2 + mysql)
07/07/2009 // No comment // Category: My Everything // Thẻ: apache2, debian, debian, lenny, linux, mod_python, mysql, python.This is a short note on how to build a Django development environment in a Debian Lenny server.
1. Update and upgrade apt-get
apt-get update && apt-get upgrade
2. Grab all the packages needed
apt-get install apache2 mysql-server libapache2-mod-python python-mysqldb python-imaging python-django subversion php5 mysql-client php5-mysql
3. Check out Django
cd /usr/lib/python2.5/site-packages
svn co http://code.djangoproject.com/svn/django/trunk/django django
ln -s /usr/lib/python2.5/site-packages/django/bin/django-admin.py /usr/local/bin
cd /var/www
django-admin.py startproject sample_project
4. Change the /etc/apache2/httpd.conf
<Location "/">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE sample_project.settings
PythonOption django.root /sample_project
PythonDebug On
PythonPath "['/var/www'] + sys.path"
</Location>Alias /admin_media/ /usr/lib/python2.5/site-packages/django/contrib/admin/media/
<Location "/admin_media/">
SetHandler None
</Location>
5. Restart the apache server
/etc/init.d/apache2 restart
6. Change mysql password root
mysql -u root
mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD(’new-password’) WHERE user=’root’;
mysql> FLUSH PRIVILEGES;
6. Create database & user
CREATE DATABASE db_name;
GRANT ALL ON db_name.* to user_name WITH GRANT OPTION;
SET PASSWORD FOR user_name = password(’password_here’);
7. Modify the database connection in sample_project.settings
8. Now you can follow the Django tutorial
9. Test django on apache http://localhost/
Leave a Reply
Recent Posts
Recent Comments
- car on Google App Engine & cron jobs
- Rodrigo Marangon on Mod_python + Apache 2 + Slackware Error
- gabriel on Install packages for PEAR in XAMPP (Ubuntu Linux)
- mod_python on Apache 2 | Miscellaneous musings in beta on Mod_python + Apache 2 + Slackware Error
- Gilberto Ramos on Get back your Alt+Ctrl+Backspace in Karmic
Blogroll
car: nice engine, i'll try to pimp my ride
Rodrigo Marangon: Thanks for sharing! It was very helpful. Another way to make mod_python work is replacing the ...
gabriel: just the info that I was looking for... tnx ...
Gilberto Ramos: very useful! i was looking for this..!
Venkat Mantirraju: This is an excellent guide. Thanks a lot for your effort and time in making ...
How to clear DNS cache in Mac (Tiger, Leopard, Snow Leopard)
31/07/2010
Validation with Jquery
26/07/2010
Add your Google Apps email to Palm Pre
19/07/2010
Install packages for PEAR in XAMPP (Ubuntu Linux)
17/03/2010
Skype on Ubuntu Lucid Lynx 10.04
17/03/2010
Eclipse 3.5 Galileo on Ubuntu Jaunty 9.04
| 12 comments
Google App Engine & cron jobs
| 4 comments
vmware-tools on Slackware 12.1
| 3 comments
Django, Mod-Python & CouchDB
| 2 comments
Mapnik installation on Slackware 12.1
| 2 comments
- © 2009 Tech Mix. All rights reserved.
- WPLine 1.0 designed by Hutek - A member of Vietnam Wordpress Commnunity.
- Powered by Wordpress. Work fine on almost popular browsers.

