Django configuration in Windows

Source: Internet
Author: User
Tags tortoisesvn
Configure mod_python

1. Use apache_2.0.54-win32-x86-no_ssl.msi
Http://archive.apache.org/dist/httpd/binaries/win32/

2.install mod_python-3.2.8.win32-py2.4.exe
Http://apache.justdn.org/httpd/modpython/

Mod_python Chinese Document
Http://man.chinaunix.net/develop/python/mod_python/mod_python.h

3. Configure apache2 \ conf \ httpd. conf

Add
Loadmodule python_module modules/mod_python.so

<Directory "D:/Apache Group/Apache2/htdocs">        AddHandler mod_python .py        PythonHandler mptest        PythonDebug On</Directory>

4. View http: // localhost: 8080/mptest. py and test whether mod_python is configured successfully.

Configure Django

Http://thinkhole.org/wp/2006/04/03/django-on-windows-howto/
Django step by step

1. http://tortoisesvn.sourceforge.net/downloading tortoisesvn
Checkout http://code.djangoproject.com/svn/django/trunk/django
Copy Django to E: \ python24 \ Lib \ Site-packages \
Copy E: \ python24 \ Lib \ Site-packages \ Django \ bin \ django-admin.py to E: \ python24 \ scripts

2. Run import Django through shell. If it runs successfully, the installation is successful.

3. Create a web project, path E: \ mysite
First add the environment variable, Path = E: \ python24 \; E: \ python24 \ scripts;
We recommend that you add pathext =. py
Django-admin.py can be executed without an extension

E: \ mysite> django-admin.py startproject mysite

A mysite directory is generated, including _ init _. py, manage. py, settings. py, and URLs. py.
_ Init _. py indicates that mysite is a python package.
Manage. py manage applications
Settings. py configure the application
URLs. py URL ing

E: \ mysite> Python manage. py runserver

View the http: // localhost: 8000/Page

4. Configure to Apache

<Location "/mysite/">    SetHandler python-program    PythonHandler django.core.handlers.modpython    SetEnv DJANGO_SETTINGS_MODULE mysite.settings    PythonPath "['E:\mysite'] + sys.path"    PythonDebug On</Location><Location "/media/">    SetHandler None</Location><LocationMatch "\.(jpg|gif|png)$">    SetHandler None</LocationMatch>

Visit http: // localhost: 8080/mysite/

5. Install the database
PostgreSQL
Http://wwwmaster.postgresql.org/download/mirrors-ftp? File?binary=2fv8.1.3%2fwin32%2f%sql-8.1.3-1.zip

SQLite
Http://www.sqlite.org/download.html

Pysqlite
Http://www.initd.org/tracker/pysqlite

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.