<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>一个程序猿 &#187; Python</title>
	<atom:link href="http://www.sunboyu.cn/category/original/python/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sunboyu.cn</link>
	<description>时光不会倒流,脚步总要前进</description>
	<pubDate>Tue, 31 Jan 2012 10:50:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>django&#124;python中图形验证码的实现</title>
		<link>http://www.sunboyu.cn/2010/03/23/djangopython%e4%b8%ad%e5%9b%be%e5%bd%a2%e9%aa%8c%e8%af%81%e7%a0%81%e7%9a%84%e5%ae%9e%e7%8e%b0.shtml</link>
		<comments>http://www.sunboyu.cn/2010/03/23/djangopython%e4%b8%ad%e5%9b%be%e5%bd%a2%e9%aa%8c%e8%af%81%e7%a0%81%e7%9a%84%e5%ae%9e%e7%8e%b0.shtml#comments</comments>
		<pubDate>Tue, 23 Mar 2010 06:01:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1195</guid>
		<description><![CDATA[python自己并没有带图型库，需要借助第三方的图形库来实现。原来习惯的就是php下的gd库，但网上搜索后普遍说gd的python接口不好用，又考虑php也即将抛弃dg，就选择了很多人推荐的 PIL（python image library） 库。
首先是安装此库，http://www.pythonware.com/products/pil/index.htm
选择自己相应版本和平台进行安装，安装文档写的还算清楚。
然后是代码实现：
import Image, ImageDraw, ImageFont, md5, random,cStringIO,util
def show(request):
&#160;&#160; &#160;im = Image.new('RGBA',(52,18),(50,50,50,50))
&#160;&#160; &#160;draw = ImageDraw.Draw(im)
&#160;&#160; &#160;rands = util.rand(4)&#160; //自己写的一个取随机字符串的函数
&#160;&#160; &#160;draw.text((2,0), rands[0], font=ImageFont.truetype(&#34;tahomabd.TTF&#34;, random.randrange(12,18)), fill='white')
&#160;&#160; &#160;draw.text((14,0), rands[1], font=ImageFont.truetype(&#34;tahomabd.TTF&#34;, random.randrange(12,18)), fill='yellow')
&#160;&#160; &#160;draw.text((27,0), rands[2], font=ImageFont.truetype(&#34;tahomabd.TTF&#34;, random.randrange(12,18)), fill='yellow')
&#160;&#160; &#160;draw.text((40,0), rands[3], font=ImageFont.truetype(&#34;tahomabd.TTF&#34;, random.randrange(12,18)), fill='white')&#160; 
&#160;&#160; &#160;del draw
&#160;&#160; &#160;request.session['checkcode'] = rands
&#160;&#160; &#160;buf = cStringIO.StringIO()
&#160;&#160; &#160;im.save(buf, 'gif')
&#160;&#160; &#160;return HttpResponse(buf.getvalue(),'image/gif')
修改urls.py文件
#check code
&#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>python自己并没有带图型库，需要借助第三方的图形库来实现。原来习惯的就是php下的gd库，但网上搜索后普遍说gd的python接口不好用，又考虑php也即将抛弃dg，就选择了很多人推荐的 PIL（python image library） 库。</p>
<p>首先是安装此库，http://www.pythonware.com/products/pil/index.htm</p>
<p>选择自己相应版本和平台进行安装，安装文档写的还算清楚。</p>
<p>然后是代码实现：</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">import Image, ImageDraw, ImageFont, md5, random,cStringIO,util</li>
<li>def show(request):</li>
<li>&nbsp;&nbsp; &nbsp;im = Image.new('RGBA',(52,18),(50,50,50,50))</li>
<li>&nbsp;&nbsp; &nbsp;draw = ImageDraw.Draw(im)</li>
<li>&nbsp;&nbsp; &nbsp;rands = util.rand(4)&nbsp; //自己写的一个取随机字符串的函数</li>
<li>&nbsp;&nbsp; &nbsp;draw.text((2,0), rands[0], font=ImageFont.truetype(&quot;tahomabd.TTF&quot;, random.randrange(12,18)), fill='white')</li>
<li>&nbsp;&nbsp; &nbsp;draw.text((14,0), rands[1], font=ImageFont.truetype(&quot;tahomabd.TTF&quot;, random.randrange(12,18)), fill='yellow')</li>
<li>&nbsp;&nbsp; &nbsp;draw.text((27,0), rands[2], font=ImageFont.truetype(&quot;tahomabd.TTF&quot;, random.randrange(12,18)), fill='yellow')</li>
<li>&nbsp;&nbsp; &nbsp;draw.text((40,0), rands[3], font=ImageFont.truetype(&quot;tahomabd.TTF&quot;, random.randrange(12,18)), fill='white')&nbsp; </li>
<li>&nbsp;&nbsp; &nbsp;del draw</li>
<li>&nbsp;&nbsp; &nbsp;request.session['checkcode'] = rands</li>
<li>&nbsp;&nbsp; &nbsp;buf = cStringIO.StringIO()</li>
<li>&nbsp;&nbsp; &nbsp;im.save(buf, 'gif')</li>
<li>&nbsp;&nbsp; &nbsp;return HttpResponse(buf.getvalue(),'image/gif')</li></ol></div>
<p>修改urls.py文件</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">#check code</li>
<li>&nbsp;&nbsp; &nbsp;(r'^checkcode/','view.checkcode.show'),</li></ol></div>
<p>再访问 http://127.0.0.1/checkcode/ 既可看到效果。</p>
<p>官方的手册写的比较惨，属于找什么没什么。顺便把网上找到的一个写的不错的文档传送来：http://nadiana.com/pil-tutorial-basic-advanced-drawing</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2010/03/23/djangopython%e4%b8%ad%e5%9b%be%e5%bd%a2%e9%aa%8c%e8%af%81%e7%a0%81%e7%9a%84%e5%ae%9e%e7%8e%b0.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>django中关于静态文件那些事</title>
		<link>http://www.sunboyu.cn/2010/03/20/django%e4%b8%ad%e5%85%b3%e4%ba%8e%e9%9d%99%e6%80%81%e6%96%87%e4%bb%b6%e9%82%a3%e4%ba%9b%e4%ba%8b.shtml</link>
		<comments>http://www.sunboyu.cn/2010/03/20/django%e4%b8%ad%e5%85%b3%e4%ba%8e%e9%9d%99%e6%80%81%e6%96%87%e4%bb%b6%e9%82%a3%e4%ba%9b%e4%ba%8b.shtml#comments</comments>
		<pubDate>Sat, 20 Mar 2010 09:10:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1191</guid>
		<description><![CDATA[那个500错误快把我整死了，结果才分析可能django把静态文件当脚本处理了。
对于线上部署，完全可以用rewrite的方式进行解决。可本机调试，用的是自带的server，可搞死人了。
不过搜索后发现，django解决这个问题了，使用一个叫做 django.views.static.serve 的方法处理这些静态文件。
实现代码如下:
在/urls.py 文件中
from os import path
底下增加
if settings.DEBUG:
&#160;&#160; &#160;urlpatterns += patterns('', (r'^static/(?P&#60;path&#62;.*)$', 'django.views.static.serve', {'document_root': path.join(path.dirname(__file__),'static')}), )
&#60;/path&#62;
然后，把所有静态文件放到 static 目录下，即可。
不过这种方式只适合开发环境，在线上的时候还是需要把这个问题交给httpserver
]]></description>
			<content:encoded><![CDATA[<p>那个500错误快把我整死了，结果才分析可能django把静态文件当脚本处理了。</p>
<p>对于线上部署，完全可以用rewrite的方式进行解决。可本机调试，用的是自带的server，可搞死人了。</p>
<p>不过搜索后发现，django解决这个问题了，使用一个叫做 django.views.static.serve 的方法处理这些静态文件。</p>
<p>实现代码如下:</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">在/urls.py 文件中</li>
<li>from os import path</li>
<li>底下增加</li>
<li>if settings.DEBUG:</li>
<li>&nbsp;&nbsp; &nbsp;urlpatterns += patterns('', (r'^static/(?P&lt;path&gt;.*)$', 'django.views.static.serve', {'document_root': path.join(path.dirname(__file__),'static')}), )</li>
<li>&lt;/path&gt;</li></ol></div>
<p>然后，把所有静态文件放到 static 目录下，即可。</p>
<p>不过这种方式只适合开发环境，在线上的时候还是需要把这个问题交给httpserver</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2010/03/20/django%e4%b8%ad%e5%85%b3%e4%ba%8e%e9%9d%99%e6%80%81%e6%96%87%e4%bb%b6%e9%82%a3%e4%ba%9b%e4%ba%8b.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>小改EditPlus打造python开发环境</title>
		<link>http://www.sunboyu.cn/2010/01/10/%e5%b0%8f%e6%94%b9editplus%e6%89%93%e9%80%a0python%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83.shtml</link>
		<comments>http://www.sunboyu.cn/2010/01/10/%e5%b0%8f%e6%94%b9editplus%e6%89%93%e9%80%a0python%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83.shtml#comments</comments>
		<pubDate>Sun, 10 Jan 2010 13:00:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[原创技术]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1148</guid>
		<description><![CDATA[editplus默认是不支持python开发的，但官方提供了相关的支持：
http://www.editplus.com/dn.cgi?python3.zip
在 菜单->工具选择->语法 中，可以新建语法类型 python,扩展名 py,语法文件为python.stx,自动完成文件为python.acp
即可。
]]></description>
			<content:encoded><![CDATA[<p>editplus默认是不支持python开发的，但官方提供了相关的支持：</p>
<p>http://www.editplus.com/dn.cgi?python3.zip</p>
<p>在 菜单->工具选择->语法 中，可以新建语法类型 python,扩展名 py,语法文件为python.stx,自动完成文件为python.acp</p>
<p>即可。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2010/01/10/%e5%b0%8f%e6%94%b9editplus%e6%89%93%e9%80%a0python%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>django进程管理器</title>
		<link>http://www.sunboyu.cn/2009/12/16/django%e8%bf%9b%e7%a8%8b%e7%ae%a1%e7%90%86%e5%99%a8.shtml</link>
		<comments>http://www.sunboyu.cn/2009/12/16/django%e8%bf%9b%e7%a8%8b%e7%ae%a1%e7%90%86%e5%99%a8.shtml#comments</comments>
		<pubDate>Wed, 16 Dec 2009 08:42:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1099</guid>
		<description><![CDATA[nginx+php，php有个进程管理器，为php-fpm，Django没有，网上大概看了看，找出了几段，小改一下，能用了。
#!/bin/bash
siteroot=&#34;/home/project/sun&#34;
sitename=&#34;http://python.sunboyu.cn&#34;
cd $siteroot
if [ $# -lt 1 ];then
&#160;&#160; &#160;echo &#34;Usages: server.sh [start&#124;stop&#124;restart]&#34;
&#160;&#160; &#160;exit 0
fi
&#160;
if [ $1 = start ];then
&#160;&#160; &#160;isrun=`ps aux&#124;grep &#34;manage.py runfcgi&#34;&#124;grep -v &#34;grep&#34;&#124;wc -l`
&#160;&#160; &#160;if [ $isrun -eq 1 ];then
&#160;&#160; &#160; &#160; &#160;echo $sitename&#34; has running!&#34;
&#160;&#160; &#160; &#160; &#160;exit 0
&#160;&#160; &#160;else
&#160;&#160; &#160; &#160; &#160;python manage.py runfcgi method=threaded host=127.0.0.1 port=8000 --settings=settings
&#160;&#160; &#160; &#160; &#160;echo $sitename&#34;is [...]]]></description>
			<content:encoded><![CDATA[<p>nginx+php，php有个进程管理器，为php-fpm，Django没有，网上大概看了看，找出了几段，小改一下，能用了。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">#!/bin/bash</li>
<li>siteroot=&quot;/home/project/sun&quot;</li>
<li>sitename=&quot;http://python.sunboyu.cn&quot;</li>
<li>cd $siteroot</li>
<li>if [ $# -lt 1 ];then</li>
<li>&nbsp;&nbsp; &nbsp;echo &quot;Usages: server.sh [start|stop|restart]&quot;</li>
<li>&nbsp;&nbsp; &nbsp;exit 0</li>
<li>fi</li>
<li>&nbsp;</li>
<li>if [ $1 = start ];then</li>
<li>&nbsp;&nbsp; &nbsp;isrun=`ps aux|grep &quot;manage.py runfcgi&quot;|grep -v &quot;grep&quot;|wc -l`</li>
<li>&nbsp;&nbsp; &nbsp;if [ $isrun -eq 1 ];then</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;echo $sitename&quot; has running!&quot;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;exit 0</li>
<li>&nbsp;&nbsp; &nbsp;else</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;python manage.py runfcgi method=threaded host=127.0.0.1 port=8000 --settings=settings</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;echo $sitename&quot;is running!!&quot;</li>
<li>&nbsp;&nbsp; &nbsp;fi</li>
<li>elif [ $1 = stop ];then</li>
<li>&nbsp;&nbsp; &nbsp;djid=`ps aux|grep &quot;manage.py runfcgi&quot;|grep -v &quot;grep&quot;|awk '{print $2}'`</li>
<li>&nbsp;&nbsp; &nbsp;kill -9 $djid</li>
<li>&nbsp;&nbsp; &nbsp;echo $sitename&quot; is stop!&quot;</li>
<li>elif [ $1 = restart ];then</li>
<li>&nbsp;&nbsp; &nbsp;djid=`ps aux|grep &quot;manage.py runfcgi&quot;|grep -v &quot;grep&quot;|awk '{print $2}'`</li>
<li>&nbsp;&nbsp; &nbsp;kill -9 $djid</li>
<li>&nbsp;&nbsp; &nbsp;echo $sitename&quot; is stop!!&quot;</li>
<li>&nbsp;&nbsp; &nbsp;python manage.py runfcgi method=threaded host=127.0.0.1 port=8000 --settings=settings</li>
<li>&nbsp;&nbsp; &nbsp;echo $sitename&quot; is start!!&quot;</li>
<li>else</li>
<li>&nbsp;&nbsp; &nbsp;echo &quot;Usages: server.sh [start|stop|restart]&quot;</li>
<li>fi</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/12/16/django%e8%bf%9b%e7%a8%8b%e7%ae%a1%e7%90%86%e5%99%a8.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>django+nginx的部分配置</title>
		<link>http://www.sunboyu.cn/2009/12/16/djangonginx%e7%9a%84%e9%83%a8%e5%88%86%e9%85%8d%e7%bd%ae.shtml</link>
		<comments>http://www.sunboyu.cn/2009/12/16/djangonginx%e7%9a%84%e9%83%a8%e5%88%86%e9%85%8d%e7%bd%ae.shtml#comments</comments>
		<pubDate>Wed, 16 Dec 2009 03:26:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[原创技术]]></category>

		<category><![CDATA[django]]></category>

		<category><![CDATA[nginx]]></category>

		<category><![CDATA[配置]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1097</guid>
		<description><![CDATA[nginx的配置，特别感谢爱词霸的吕同学，发扬了开源共享的精神，大大缩短了我的调试成本。
server {
&#160;&#160; &#160;listen 80;
&#160;&#160; &#160;server_name python.sunboyu.cn;
&#160;&#160; &#160;location / {
&#160;&#160; &#160; &#160; &#160; &#160;fastcgi_pass 127.0.0.1:8000;
&#160;&#160; &#160; &#160; &#160; &#160;fastcgi_buffers&#160; &#160; &#160; 16&#160; 128k;
&#160;&#160; &#160; &#160; &#160; &#160;fastcgi_ignore_client_abort&#160; on;
&#160;&#160; &#160; &#160; &#160; &#160;fastcgi_read_timeout 60;
&#160;
&#160;&#160; &#160; &#160; &#160; &#160;fastcgi_param PATH_INFO $fastcgi_script_name;
&#160;&#160; &#160; &#160; &#160; &#160;fastcgi_param REQUEST_METHOD $request_method;
&#160;&#160; &#160; &#160; &#160; &#160;fastcgi_param QUERY_STRING $query_string;
&#160;&#160; &#160; &#160; &#160; &#160;fastcgi_param CONTENT_TYPE [...]]]></description>
			<content:encoded><![CDATA[<p>nginx的配置，特别感谢<a href='http://www.iciba.com/' target='_blank'>爱词霸</a>的<a href='http://blog.lvscar.info/' target='_blank'>吕同学</a>，发扬了开源共享的精神，大大缩短了我的调试成本。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">server {</li>
<li>&nbsp;&nbsp; &nbsp;listen 80;</li>
<li>&nbsp;&nbsp; &nbsp;server_name python.sunboyu.cn;</li>
<li>&nbsp;&nbsp; &nbsp;location / {</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_pass 127.0.0.1:8000;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_buffers&nbsp; &nbsp; &nbsp; 16&nbsp; 128k;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_ignore_client_abort&nbsp; on;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_read_timeout 60;</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_param PATH_INFO $fastcgi_script_name;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_param REQUEST_METHOD $request_method;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_param QUERY_STRING $query_string;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_param CONTENT_TYPE $content_type;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_param CONTENT_LENGTH $content_length;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_param SERVER_PROTOCOL&nbsp; $server_protocol;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_param SERVER_PORT&nbsp; &nbsp; &nbsp; $server_port;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_param SERVER_NAME&nbsp; $server_name;</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_pass_header Authorization;</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;fastcgi_intercept_errors off;</li>
<li>&nbsp;</li>
<li>&nbsp;&nbsp; &nbsp;}</li>
<li>}</li></ol></div>
<p>同时附上一个额外的文档，nginx变量跟cgi协议的对应关系。<br />
注：在配置中，并不是所有的变量必须加上，而是根据环境选择其中应该有的变量，至于具体加哪些变量，得求助高人了。</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">#&nbsp; &nbsp; Fast CGI param reference</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; SCRIPT_FILENAME&nbsp; $document_root$fastcgi_script_name;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; QUERY_STRING&nbsp; $query_string;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; REQUEST_METHOD&nbsp; $request_method;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; CONTENT_TYPE&nbsp; $content_type;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; CONTENT_LENGTH&nbsp; $content_length;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; GATEWAY_INTERFACE&nbsp; CGI/1.1;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; SERVER_SOFTWARE&nbsp; nginx;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; SCRIPT_NAME&nbsp; $fastcgi_script_name;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; REQUEST_URI&nbsp; $request_uri;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; DOCUMENT_URI&nbsp; $document_uri;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; DOCUMENT_ROOT&nbsp; $document_root;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; SERVER_PROTOCOL&nbsp; $server_protocol;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; REMOTE_ADDR&nbsp; $remote_addr;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; REMOTE_PORT&nbsp; $remote_port;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; SERVER_ADDR&nbsp; $server_addr;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; SERVER_PORT&nbsp; $server_port;</li>
<li>#&nbsp; &nbsp; fastcgi_param&nbsp; &nbsp; SERVER_NAME&nbsp; $server_name;</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/12/16/djangonginx%e7%9a%84%e9%83%a8%e5%88%86%e9%85%8d%e7%bd%ae.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>django笔记3-DEMO篇</title>
		<link>http://www.sunboyu.cn/2009/12/15/django%e7%ac%94%e8%ae%b03-demo%e7%af%87.shtml</link>
		<comments>http://www.sunboyu.cn/2009/12/15/django%e7%ac%94%e8%ae%b03-demo%e7%af%87.shtml#comments</comments>
		<pubDate>Tue, 15 Dec 2009 13:06:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[原创技术]]></category>

		<category><![CDATA[demo]]></category>

		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1089</guid>
		<description><![CDATA[1、创建一个project（可理解为站点）
django-admin.py startproject project1
发现新建了一个文件夹 project1
2、创建一个app（可理解为一个……）
python manage.py app1
发现多了一个文件夹 app1
3 、vi ./app1/views.py  增加代码
from django.http import HttpResponse
def index(self,request):
&#160;&#160; &#160;return HttpResponse('hello test')
4、vi ./urls.py  增加代码
( r&#8217;^tests/&#8217; , &#8216;project1.app1.views.index&#8217; ),
5、启动服务
python manage.py runserver domain.com:8000
然后在浏览器打 domain.com:8000/tests
如果能看到 hello test则证明配置成功。
如果不成功，看debug信息吧，debug默认是开启的。
另外我自己配置使用fastcgi方式运行python，python manage.py runfcgi host=127.0.0.1 port=8000,然后用nginx代理访问。两种方式还有所不同，具体的不同点暂时还不知道，希望知道这些差别的大大们多加提示，继续研究中。
]]></description>
			<content:encoded><![CDATA[<p>1、创建一个project（可理解为站点）</p>
<p>django-admin.py startproject project1</p>
<p>发现新建了一个文件夹 project1</p>
<p>2、创建一个app（可理解为一个……）</p>
<p>python manage.py app1</p>
<p>发现多了一个文件夹 app1</p>
<p>3 、vi ./app1/views.py  增加代码</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">from django.http import HttpResponse</li>
<li>def index(self,request):</li>
<li>&nbsp;&nbsp; &nbsp;return HttpResponse('hello test')</li></ol></div>
<p>4、vi ./urls.py  增加代码<br />
( r&#8217;^tests/&#8217; , &#8216;project1.app1.views.index&#8217; ),</p>
<p>5、启动服务</p>
<p>python manage.py runserver domain.com:8000</p>
<p>然后在浏览器打 domain.com:8000/tests</p>
<p>如果能看到 hello test则证明配置成功。</p>
<p>如果不成功，看debug信息吧，debug默认是开启的。</p>
<blockquote><p>另外我自己配置使用fastcgi方式运行python，python manage.py runfcgi host=127.0.0.1 port=8000,然后用nginx代理访问。两种方式还有所不同，具体的不同点暂时还不知道，希望知道这些差别的大大们多加提示，继续研究中。</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/12/15/django%e7%ac%94%e8%ae%b03-demo%e7%af%87.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>django笔记2-配置篇</title>
		<link>http://www.sunboyu.cn/2009/12/15/django%e7%ac%94%e8%ae%b02-%e9%85%8d%e7%bd%ae%e7%af%87.shtml</link>
		<comments>http://www.sunboyu.cn/2009/12/15/django%e7%ac%94%e8%ae%b02-%e9%85%8d%e7%bd%ae%e7%af%87.shtml#comments</comments>
		<pubDate>Tue, 15 Dec 2009 12:37:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[原创技术]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1086</guid>
		<description><![CDATA[1、升级linux的python为最新版本
ln -s /usr/bin/python /opt/python**{your install path}**/bin/python
2、设置django-admin.py至系统命令
ln -s /opt/python**{your install path}**/lib/python2.5/site-packages/django/bin/django-admin.py  /usr/bin/django-admin.py
然后查看 django-admin.py &#8211;version
回显版本正确，则证明系统配置成功。
]]></description>
			<content:encoded><![CDATA[<p>1、升级linux的python为最新版本</p>
<p>ln -s /usr/bin/python /opt/python**{your install path}**/bin/python</p>
<p>2、设置django-admin.py至系统命令</p>
<p>ln -s /opt/python**{your install path}**/lib/python2.5/site-packages/django/bin/django-admin.py  /usr/bin/django-admin.py</p>
<p>然后查看 django-admin.py &#8211;version</p>
<p>回显版本正确，则证明系统配置成功。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/12/15/django%e7%ac%94%e8%ae%b02-%e9%85%8d%e7%bd%ae%e7%af%87.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>django笔记1-安装篇</title>
		<link>http://www.sunboyu.cn/2009/12/14/django%e7%ac%94%e8%ae%b01-%e5%ae%89%e8%a3%85%e7%af%87.shtml</link>
		<comments>http://www.sunboyu.cn/2009/12/14/django%e7%ac%94%e8%ae%b01-%e5%ae%89%e8%a3%85%e7%af%87.shtml#comments</comments>
		<pubDate>Mon, 14 Dec 2009 11:02:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[原创技术]]></category>

		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=1082</guid>
		<description><![CDATA[1、安装django，当然要安装python，我安装的python2.5
./configure &#8211;prefix=你的路径
2、安装mysqldb
这个可以看这篇文章 http://www.sunboyu.cn/2009/04/22/python25mysqldb122%E5%AE%89%E8%A3%85.shtml
3、安装easl_install
http://pypi.python.org/pypi/setuptools  我下的源码，按照提示安装就行
4、使用easl_install安装flup
地址 http://www.saddi.com/software/flup/dist/flup-1.0.2-py2.5.egg
5、安装django1.1
python setup install
到这里大体就算安装完了，底下配置。
]]></description>
			<content:encoded><![CDATA[<p>1、安装django，当然要安装python，我安装的python2.5</p>
<p>./configure &#8211;prefix=你的路径</p>
<p>2、安装mysqldb</p>
<p>这个可以看这篇文章 http://www.sunboyu.cn/2009/04/22/python25mysqldb122%E5%AE%89%E8%A3%85.shtml</p>
<p>3、安装easl_install</p>
<p>http://pypi.python.org/pypi/setuptools  我下的源码，按照提示安装就行</p>
<p>4、使用easl_install安装flup</p>
<p>地址 http://www.saddi.com/software/flup/dist/flup-1.0.2-py2.5.egg</p>
<p>5、安装django1.1</p>
<p>python setup install</p>
<p>到这里大体就算安装完了，底下配置。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/12/14/django%e7%ac%94%e8%ae%b01-%e5%ae%89%e8%a3%85%e7%af%87.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>Python写的数据库备份程序</title>
		<link>http://www.sunboyu.cn/2009/04/22/python%e5%86%99%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e5%a4%87%e4%bb%bd%e7%a8%8b%e5%ba%8f.shtml</link>
		<comments>http://www.sunboyu.cn/2009/04/22/python%e5%86%99%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e5%a4%87%e4%bb%bd%e7%a8%8b%e5%ba%8f.shtml#comments</comments>
		<pubDate>Tue, 21 Apr 2009 17:55:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[MYSQL]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=664</guid>
		<description><![CDATA[下载地址:mysqlbak
#!/var/opt/python-2.5/bin/python
import os
import time
import MySQLdb
&#160;
&#160;
CFG = {}
CFG['root'] = {}
CFG['root']['hostname'] = 'localhost'
CFG['root']['username'] = 'root'
CFG['root']['password'] = 'test'
&#160;
&#160;
CFG['mysqldump'] = '/opt/mysql-5.0.22/bin/mysqldump'
&#160;
CFG['time'] = time.strftime(&#34;%Y-%m-%d&#34;, time.localtime(time.time()) ) 
&#160;
CFG['bakpath'] = '/tmp/' + CFG['time']
CFG['mainbak'] = '/home/sunboyu/databak/' + CFG['time']
&#160;
&#160;
if os.path.exists( CFG['bakpath'] ) == False:
&#160;&#160; &#160;os.mkdir( CFG['bakpath'] )
if os.path.exists( CFG['mainbak'] ) == False:
&#160;&#160; &#160;os.mkdir( CFG['mainbak'] )
&#160;
def mysql_database_bak( database ):
&#160;&#160; &#160;global CFG
&#160;&#160; &#160;DIR = CFG['bakpath'] + &#34;/&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>下载地址:<a href='http://www.sunboyu.cn/upfiles/2009/04/mysqlbak.rar'>mysqlbak</a></p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">#!/var/opt/python-2.5/bin/python</li>
<li>import os</li>
<li>import time</li>
<li>import MySQLdb</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
<li>CFG = {}</li>
<li>CFG['root'] = {}</li>
<li>CFG['root']['hostname'] = 'localhost'</li>
<li>CFG['root']['username'] = 'root'</li>
<li>CFG['root']['password'] = 'test'</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
<li>CFG['mysqldump'] = '/opt/mysql-5.0.22/bin/mysqldump'</li>
<li>&nbsp;</li>
<li>CFG['time'] = time.strftime(&quot;%Y-%m-%d&quot;, time.localtime(time.time()) ) </li>
<li>&nbsp;</li>
<li>CFG['bakpath'] = '/tmp/' + CFG['time']</li>
<li>CFG['mainbak'] = '/home/sunboyu/databak/' + CFG['time']</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
<li>if os.path.exists( CFG['bakpath'] ) == False:</li>
<li>&nbsp;&nbsp; &nbsp;os.mkdir( CFG['bakpath'] )</li>
<li>if os.path.exists( CFG['mainbak'] ) == False:</li>
<li>&nbsp;&nbsp; &nbsp;os.mkdir( CFG['mainbak'] )</li>
<li>&nbsp;</li>
<li>def mysql_database_bak( database ):</li>
<li>&nbsp;&nbsp; &nbsp;global CFG</li>
<li>&nbsp;&nbsp; &nbsp;DIR = CFG['bakpath'] + &quot;/&quot; + database</li>
<li>&nbsp;&nbsp; &nbsp;if os.path.exists( DIR )==False:</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;os.mkdir( DIR )</li>
<li>&nbsp;&nbsp; &nbsp;conn = MySQLdb.connect( host = CFG['root']['hostname'] , user = CFG['root']['username'] , passwd = CFG['root']['password'] , db = database )</li>
<li>&nbsp;&nbsp; &nbsp;db = conn.cursor()</li>
<li>&nbsp;&nbsp; &nbsp;sql = &quot;show tables&quot;;</li>
<li>&nbsp;&nbsp; &nbsp;db.execute( sql )</li>
<li>&nbsp;&nbsp; &nbsp;result = {}</li>
<li>&nbsp;&nbsp; &nbsp;for recordline in db.fetchall():</li>
<li>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;os.system( CFG['mysqldump'] + &quot; --opt&nbsp; &quot; + database + &quot; &quot; + recordline[0] + &quot; -u&quot; + CFG['root']['username'] + &quot; -p&quot; + CFG['root']['password'] + &quot; &gt; &quot; + DIR + &quot;/&quot; + database + &quot;_&quot; + recordline[0] + &quot;.sql&quot; )</li>
<li>&nbsp;&nbsp; &nbsp;os.system( &quot;tar cvf &quot; + CFG['bakpath'] + &quot;/&quot; + database + &quot;.tar.gz &quot; +&nbsp; CFG['bakpath'] + &quot;/&quot; + database )</li>
<li>&nbsp;&nbsp; &nbsp;os.system( &quot;mv &quot; + CFG['bakpath'] + &quot;/&quot; + database + &quot;.tar.gz &quot; + CFG['mainbak'] + '/' )</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
<li>conn = MySQLdb.connect( host = CFG['root']['hostname'] , user = CFG['root']['username'] , passwd = CFG['root']['password'] , db = 'test' )</li>
<li>sql = &quot;show databases&quot;;</li>
<li>db = conn.cursor()</li>
<li>db.execute( sql )</li>
<li>result = {}</li>
<li>bigcount = 0</li>
<li>for recordline in db.fetchall():</li>
<li>	littlecount = 0</li>
<li>	result[bigcount] = {}</li>
<li>	for colnum in db.description:</li>
<li>	&nbsp; &nbsp; result[bigcount][colnum[0]] = recordline[littlecount]</li>
<li>	&nbsp; &nbsp; littlecount += 1</li>
<li>	bigcount += 1</li>
<li>&nbsp;</li>
<li>&nbsp;</li>
<li>for tables in result:</li>
<li>&nbsp;&nbsp; &nbsp;mysql_database_bak( result[tables]['Database'] )</li>
<li>&nbsp;</li>
<li>os.system( &quot;rm -rf /tmp/&quot; + CFG['time'] )&nbsp; #警告 rm -rf 这个命令相当危险，使用一定要谨慎</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/04/22/python%e5%86%99%e7%9a%84%e6%95%b0%e6%8d%ae%e5%ba%93%e5%a4%87%e4%bb%bd%e7%a8%8b%e5%ba%8f.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>python2.5+MySQLdb1.2.2安装</title>
		<link>http://www.sunboyu.cn/2009/04/22/python25mysqldb122%e5%ae%89%e8%a3%85.shtml</link>
		<comments>http://www.sunboyu.cn/2009/04/22/python25mysqldb122%e5%ae%89%e8%a3%85.shtml#comments</comments>
		<pubDate>Tue, 21 Apr 2009 16:04:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[LINUX]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[MySQLdb]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=662</guid>
		<description><![CDATA[最近比较喜欢用python写一些shell，又因为要跟mysql交互，所以安装python2.5＋MySQLdb1.2.2。
选择python而没有选择perl，c之类，是因为python语法相对简单，适合我。其实php也可以，但linux默认安装python并大量使用，而并不默认安装PHP。
在安装过程中遇到很多问题，暂不罗列，google是半万能的，多尝试。
使用这两个版本，是因为在编译过程中的问题，逼我仔细阅读了产品稳当，发现版本依赖性很强，最终选择的这两个。
python编译很简单 ./configure &#8211;prefix=/*****  就OK了。
MySQLdb的安装也很简单,但首先要修改site.cfg的参数，其中threadsafe和mysql_config的值要根据情况修改。
python setup.py build
（如果必要，中间运行这个  ln -s /opt/mysql-5.0.22/lib/libmysqlclient.a ./build/lib.linux-x86_64-2.4/_mysql.so 路径自己调整）
python setup.py install
]]></description>
			<content:encoded><![CDATA[<p>最近比较喜欢用python写一些shell，又因为要跟mysql交互，所以安装python2.5＋MySQLdb1.2.2。</p>
<p>选择python而没有选择perl，c之类，是因为python语法相对简单，适合我。其实php也可以，但linux默认安装python并大量使用，而并不默认安装PHP。</p>
<p>在安装过程中遇到很多问题，暂不罗列，google是半万能的，多尝试。</p>
<p>使用这两个版本，是因为在编译过程中的问题，逼我仔细阅读了产品稳当，发现版本依赖性很强，最终选择的这两个。</p>
<p>python编译很简单 ./configure &#8211;prefix=/*****  就OK了。</p>
<p>MySQLdb的安装也很简单,但首先要修改site.cfg的参数，其中threadsafe和mysql_config的值要根据情况修改。</p>
<p>python setup.py build<br />
（如果必要，中间运行这个  ln -s /opt/mysql-5.0.22/lib/libmysqlclient.a ./build/lib.linux-x86_64-2.4/_mysql.so 路径自己调整）<br />
python setup.py install</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/04/22/python25mysqldb122%e5%ae%89%e8%a3%85.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>解决了该死的权限问题，是否真的有效</title>
		<link>http://www.sunboyu.cn/2009/03/12/%e8%a7%a3%e5%86%b3%e4%ba%86%e8%af%a5%e6%ad%bb%e7%9a%84%e6%9d%83%e9%99%90%e9%97%ae%e9%a2%98%ef%bc%8c%e6%98%af%e5%90%a6%e7%9c%9f%e7%9a%84%e6%9c%89%e6%95%88.shtml</link>
		<comments>http://www.sunboyu.cn/2009/03/12/%e8%a7%a3%e5%86%b3%e4%ba%86%e8%af%a5%e6%ad%bb%e7%9a%84%e6%9d%83%e9%99%90%e9%97%ae%e9%a2%98%ef%bc%8c%e6%98%af%e5%90%a6%e7%9c%9f%e7%9a%84%e6%9c%89%e6%95%88.shtml#comments</comments>
		<pubDate>Thu, 12 Mar 2009 15:43:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Python]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=600</guid>
		<description><![CDATA[我的apache＋php权限是配置的最为严格的，当然，在用的时候难免伴随着混乱的账户情况，linux的权限机制也是很让人头疼的，终于，还是在风平浪静种碰到了麻烦。
我不认为PHP很强，因为它只是一个面向Web的脚本语言，而PHP的开发者却赋予了它太多，让人去用，有人也滥用。
当然，一门语言能解决N多问题是好的，比如汇编，C，但终究PHP有它跨不过的坎。毕竟它只是web脚本语言。
权限出现很大的问题，至今没有搞透，说白了对linux还是一知半解，使用python写了个第三方的东西，很完美得跳跃了权限的问题。至于效率，python肯定要比php强的，起码PHP作为服务器端程序运行，PHP还没有线程和进程的控制（一直没有发现），python有完善的线程进程的库。在权限管理上，python没细看，PHP在linux下有posix函数库，我一直也没有用过。
在没有更好的解决方案前，我依然用PHP做服务器端程序，python作为一些补充。也许，全部切换过去。
]]></description>
			<content:encoded><![CDATA[<p>我的apache＋php权限是配置的最为严格的，当然，在用的时候难免伴随着混乱的账户情况，linux的权限机制也是很让人头疼的，终于，还是在风平浪静种碰到了麻烦。</p>
<p>我不认为PHP很强，因为它只是一个面向Web的脚本语言，而PHP的开发者却赋予了它太多，让人去用，有人也滥用。</p>
<p>当然，一门语言能解决N多问题是好的，比如汇编，C，但终究PHP有它跨不过的坎。毕竟它只是web脚本语言。</p>
<p>权限出现很大的问题，至今没有搞透，说白了对linux还是一知半解，使用python写了个第三方的东西，很完美得跳跃了权限的问题。至于效率，python肯定要比php强的，起码PHP作为服务器端程序运行，PHP还没有线程和进程的控制（一直没有发现），python有完善的线程进程的库。在权限管理上，python没细看，PHP在linux下有posix函数库，我一直也没有用过。</p>
<p>在没有更好的解决方案前，我依然用PHP做服务器端程序，python作为一些补充。也许，全部切换过去。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/03/12/%e8%a7%a3%e5%86%b3%e4%ba%86%e8%af%a5%e6%ad%bb%e7%9a%84%e6%9d%83%e9%99%90%e9%97%ae%e9%a2%98%ef%bc%8c%e6%98%af%e5%90%a6%e7%9c%9f%e7%9a%84%e6%9c%89%e6%95%88.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>使用PYTHON小提apache下的PHP执行权限</title>
		<link>http://www.sunboyu.cn/2009/02/28/%e4%bd%bf%e7%94%a8python%e5%b0%8f%e6%8f%90apache%e4%b8%8b%e7%9a%84php%e6%89%a7%e8%a1%8c%e6%9d%83%e9%99%90.shtml</link>
		<comments>http://www.sunboyu.cn/2009/02/28/%e4%bd%bf%e7%94%a8python%e5%b0%8f%e6%8f%90apache%e4%b8%8b%e7%9a%84php%e6%89%a7%e8%a1%8c%e6%9d%83%e9%99%90.shtml#comments</comments>
		<pubDate>Sat, 28 Feb 2009 15:15:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=583</guid>
		<description><![CDATA[绕了个圈，权限彻底上去了，中间用socket通讯方式解决。
代码暂时还不安全，等拿出安全的方案后公布
]]></description>
			<content:encoded><![CDATA[<p>绕了个圈，权限彻底上去了，中间用socket通讯方式解决。<br />
代码暂时还不安全，等拿出安全的方案后公布</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/02/28/%e4%bd%bf%e7%94%a8python%e5%b0%8f%e6%8f%90apache%e4%b8%8b%e7%9a%84php%e6%89%a7%e8%a1%8c%e6%9d%83%e9%99%90.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>Python编译参数</title>
		<link>http://www.sunboyu.cn/2009/02/21/python%e7%bc%96%e8%af%91%e5%8f%82%e6%95%b0.shtml</link>
		<comments>http://www.sunboyu.cn/2009/02/21/python%e7%bc%96%e8%af%91%e5%8f%82%e6%95%b0.shtml#comments</comments>
		<pubDate>Sat, 21 Feb 2009 15:38:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[mod_python]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=573</guid>
		<description><![CDATA[python2.6.1和mod_python的编译参数
#python编译参数
./configure --prefix=/opt/python-2.6.1 \
--enable-shared \
--enable-profiling \
--with-gcc \
--with-pydebug \
--with-system-ffi \
--with-signal-module \
--with-dec-threads \
--with-threads \
--with-thread \
--with-pth \
--with-doc-strings \
--with-tsc \
--with-pymalloc \
--with-fpectl
&#160;
#python_mod编译参数
./configure --with-apxs=/opt/httpd-2.2.9 \
--with-python=/opt/python-2.6.1
]]></description>
			<content:encoded><![CDATA[<p>python2.6.1和mod_python的编译参数</p>
<div class="hl-surround"><ol class="hl-main ln-show" title="Double click to hide line number." ondblclick = "linenumber(this)"><li class="hl-firstline">#python编译参数</li>
<li>./configure --prefix=/opt/python-2.6.1 \</li>
<li>--enable-shared \</li>
<li>--enable-profiling \</li>
<li>--with-gcc \</li>
<li>--with-pydebug \</li>
<li>--with-system-ffi \</li>
<li>--with-signal-module \</li>
<li>--with-dec-threads \</li>
<li>--with-threads \</li>
<li>--with-thread \</li>
<li>--with-pth \</li>
<li>--with-doc-strings \</li>
<li>--with-tsc \</li>
<li>--with-pymalloc \</li>
<li>--with-fpectl</li>
<li>&nbsp;</li>
<li>#python_mod编译参数</li>
<li>./configure --with-apxs=/opt/httpd-2.2.9 \</li>
<li>--with-python=/opt/python-2.6.1</li></ol></div>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2009/02/21/python%e7%bc%96%e8%af%91%e5%8f%82%e6%95%b0.shtml/feed</wfw:commentRss>
		</item>
		<item>
		<title>新书，不是一般的新</title>
		<link>http://www.sunboyu.cn/2008/12/12/%e6%96%b0%e4%b9%a6%ef%bc%8c%e4%b8%8d%e6%98%af%e4%b8%80%e8%88%ac%e7%9a%84%e6%96%b0.shtml</link>
		<comments>http://www.sunboyu.cn/2008/12/12/%e6%96%b0%e4%b9%a6%ef%bc%8c%e4%b8%8d%e6%98%af%e4%b8%80%e8%88%ac%e7%9a%84%e6%96%b0.shtml#comments</comments>
		<pubDate>Fri, 12 Dec 2008 03:34:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.sunboyu.cn/?p=423</guid>
		<description><![CDATA[
中午到中关村图书大厦购得，不错。
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sunboyu.cn/upfiles/2008/12/s3140466.jpg"><img class="aligncenter size-full wp-image-424" title="s3140466" src="http://www.sunboyu.cn/upfiles/2008/12/s3140466.jpg" alt="" width="125" height="180" /></a></p>
<p>中午到中关村图书大厦购得，不错。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sunboyu.cn/2008/12/12/%e6%96%b0%e4%b9%a6%ef%bc%8c%e4%b8%8d%e6%98%af%e4%b8%80%e8%88%ac%e7%9a%84%e6%96%b0.shtml/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

