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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值