<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[运维进行时]]></title> 
<link>https://blog.liuts.com/index.php</link> 
<description><![CDATA[互联网运维与架构]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[运维进行时]]></copyright>
<item>
<link>https://blog.liuts.com/post//</link>
<title><![CDATA[WINDOW下搭建Django环境]]></title> 
<author>root &lt;admin@yourname.com&gt;</author>
<category><![CDATA[Python]]></category>
<pubDate>Thu, 22 May 2008 08:22:40 +0000</pubDate> 
<guid>https://blog.liuts.com/post//</guid> 
<description>
<![CDATA[ 
	<strong>下载软件包</strong><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>1.使用apache_2.0.63-win32-x86-openssl-0.9.7m.msi<br/>http://apache.mirror.phpchina.com/httpd/binaries/win32/apache_2.0.63-win32-x86-openssl-0.9.7m.msi<br/></div></div><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>2.安装mod_python-3.3.1.win32-py2.5-Apache2.0.exe<br/>http://apache.mirror.phpchina.com/httpd/modpython/win/3.3.1/mod_python-3.3.1.win32-py2.5-Apache2.0.exe<br/></div></div><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>3.下载Django-0.95.2.tar.gz<br/>http://www.djangoproject.com/download/0.95.2/tarball/<br/>解压，将Copy django子目录 到 c:&#92;Python25&#92;Lib&#92;site-packages&#92;<br/>Copy c:&#92;Python25&#92;Lib&#92;site-packages&#92;django&#92;bin&#92;django-admin.py 到 c:&#92;Python25&#92;Scripts<br/></div></div><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>4.通过shell,运行import django，如果成功运行，证明安装成功<br/></div></div><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>5.创建Web项目，路径E:&#92;mysite<br/>先添加环境变量，Path=c:&#92;Python25&#92;;c:&#92;Python25&#92;Scripts;<br/>建议添加PATHEXT=.py<br/>django-admin.py 就可以不带扩展名执行<br/>E:&#92;mysite>django-admin.py startproject mysite<br/><br/>生成了一个mysite目录，包含__init__.py, manage.py, settings.py, urls.py<br/>__init__.py 说明mysite是一个python包<br/>manage.py 管理应用程序<br/>settings.py 配置应用程序<br/>urls.py URL映射<br/><br/>E:&#92;mysite>python manage.py runserver<br/>查看http://localhost:8000/页面 <br/></div></div><br/>6.配置到Apache<br/><textarea name="code" class="shell" rows="15" cols="100">
LoadModule python_module modules/mod_python.so
NameVirtualHost *
<VIRTUALHOST *>
&nbsp;&nbsp;&nbsp;&nbsp;SetHandler python-program
&nbsp;&nbsp;&nbsp;&nbsp;PythonHandler django.core.handlers.modpython
&nbsp;&nbsp;&nbsp;&nbsp;SetEnv DJANGO_SETTINGS_MODULE mysite.settings
&nbsp;&nbsp;&nbsp;&nbsp;PythonPath "['e:/'] + sys.path"
&nbsp;&nbsp;&nbsp;&nbsp;PythonDebug On
</VIRTUALHOST>

<LOCATIONMATCH ?&#92;.(jpg&#124;gif&#124;png)$?>
&nbsp;&nbsp;&nbsp;&nbsp;SetHandler None
</LOCATIONMATCH>
</textarea><br/>浏览http://localhost/，正常应该可以看到Welcome Django Page。<br/>Tags - <a href="https://blog.liuts.com/tags/django%25E7%258E%25AF%25E5%25A2%2583/" rel="tag">django环境</a>
]]>
</description>
</item><item>
<link>https://blog.liuts.com/post//#blogcomment</link>
<title><![CDATA[[评论] WINDOW下搭建Django环境]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>https://blog.liuts.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>