Django在Windows下的配置

  1. 准备 Apache ModPython Python2.5 Django
    考虑还要数据库,因此选择WAMP包,在此选的是WAMPServer
    ModPython 更新较慢,现在好像还只能配合Python2.5 使用;
    Django 1.0.2 听说更新也越来越慢了
  2. 安装Apache
  3. 安装mod_python-3.3.1.win32-py2.5-Apache2.2.exe,注意选择好wampserver对对应的apache存放目录
  4. 安装Python,追加环境变量Path路径,以便在命令行能直接执行python命令
  5. 解压Django-1.0.2-final.tar.gz,在解压出目录下 python setup.py install
  6. 测试
    Copy E:\Python24\Lib\site-packages\django\bin\django-admin.py 到 一个站点目录,如
    C:\Documents and Settings\John>cd C:\
    C:\>mkdir django
    C:\>cd django

    C:\django>django-admin.py startproject testproject
    配置httpd.conf and add the following to the bottom of the file:


    <Location "/testproject/">
    SetHandler python-program
    PythonHandler django.core.handlers.modpython
    SetEnv DJANGO_SETTINGS_MODULE testproject.settings
    PythonOption django.root /testproject
    PythonDebug On
    PythonPath "['/django'] + sys.path"
    </Location>

    MaxRequestsPerChild 1

你可能感兴趣的:(apache,c,windows,django,python)