Install and configure Django mod_python apache2 MySql in Ubuntu

Source: Internet
Author: User

Installation:

Apt-Get install-y mysql-server apache2 libapache2-mod-python Python-mysqldb Python-Django

These are not currently installed

Xfsprogs Python-imaging subversion PhP5 phpMyAdmin

You can also install it using the source code:

Setuptools-0.6c11.tar.gz

./Setup. py install after setuptools is installed

Install mysql-Python, Django-1.3.1

Python setup. py install

MySQL-python-1.2.3.tar.gz

Django-1.3.1.tar.gz

Configuration:

cd /etc/apache2vi httpd.conf
Add
<Location "/">    SetHandler python-program    PythonHandler django.core.handlers.modpython    SetEnv DJANGO_SETTINGS_MODULE myproject.settings    PythonOption django.root /myproject    PythonDebug On    PythonPath "['/var/www'] + sys.path"</Location>     
Alias /adm_media/ /usr/lib/pymodules/python2.7/django/contrib/admin/media/<Location "/adm_media/"> SetHandler None</Location>  
Alias /files/ /var/www/myproject/files/<Location "/files/"> SetHandler None</Location>

Restart apache2:

/etc/init.d/apache2 restart
 
Refer:
http://codespatter.com/2008/10/15/setting-up-apache2-mod_python-mysql-and-django-on-debian-lenny-or-ubuntu-hardy-heron/
http://fosswire.com/post/2008/05/installing-mod_python-and-django-on-apache/
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.