Blog信息 |
blog名称: 日志总数:1304 评论数量:2242 留言数量:5 访问次数:7629360 建立时间:2006年5月29日 |

| |
[Django]Using Django's TemplateTags 软件技术
lhwork 发表于 2007/2/3 11:51:15 |
I've had a number of e-mails about how I include the listing of blog
tags and archives by month on the side of my website from people who
have obviously built up a blog and now want further integration with
their website.
Well, it's ultra-simple thanks to a nifty Django feature called template tags.
The concept behind template tags is simple - a quick snippet of |
|
[Django]django with apache2 软件技术
lhwork 发表于 2007/2/3 11:46:21 |
One thing that I feel is harder than it should be with django is
getting it working with Apache2. Sure the built in webserver is nice
for development, but there comes a time when you need to step up and
use a webserver for development that you can also deploy the site upon.
I have used Apache a lot in the past, but recently I have decided to move over to installing everything the Debian
way, and this will reflect that. I am goin |
|
[Django]Django 学习笔记 - Apache2 + FastCGI 软件技术
lhwork 发表于 2007/2/3 11:27:11 |
昨天开始学习Django站点的生产服务器(Production Server),尝试了一下lighttpd和Apache2,最后决定采用Apache2来搭建整个环境(其实lighttpd更为方便一些)。
虽然Apache2 + mod_python就可以跑Django站点服务,但是听说FastCGI有更优异的性能。
FastCGI applications are fast because they're persistent. There is no
per-request startup and initialization overhead. This makes possible
the development of applications which would otherwise be impractical
within the CGI paradigm (e.g. a huge Perl script, or an application
which requires a connection to |
|
[Quixote]Quixote用于网站开发 软件技术
lhwork 发表于 2007/2/2 17:50:49 |
Introduction
简介
Quixote is a framework for developing Web applications in Python. Quixote is based on a simple, flexible design, making it possible to write applications quickly and to benefit from the wide range of available third-party Python modules. Deployed appropriately, Quixote has excellent performance that allows you to put Quixote-based applications into large-scale production use.
Quixote是一个用python写的 |
|
[Quixote]Quixote + Apache with ModPython + AdoDB + Mysql 软件技术
lhwork 发表于 2007/2/2 17:44:30 |
服务器已经搭好了,其实quixote本身的demo已经够完善的了,开源的code也许都有一个特点,code是给你看的,tutorial就在code里面。
Mod_python编译好以后,在Apache里面LoadModule一下,接着定义一个Location用quixote的publisher来处理,这段在PYTHON_LIB_PATH/site-packages/quixote/server/mod_python_handler.py的注释里面有。
我的Apache默认的charset是utf-8的,我想把quixote的也弄成utf-8的,maillist上的一个朋友给了我帮助。
“
必须得改publish.py文件 找到start_request,改成下面的,我在2.2/2.3上试过. def start_request |
|
[Quixote]在dreamhost上安装quixote 软件技术
lhwork 发表于 2007/2/2 17:43:01 |
其实,无论安装什么都是一个道理。 成功与否取决于两个因素:配置文件的正确、应有的权限设置。 具体的步骤就不说了,只说几个关键步骤: 1、CD到一个合适的目录,这里假设是 /home/yourusername/youdomain,执行:wget http://www.mems-exchange.org/software/files/quixote/Quixote-2.4.tar.gz 2、tar xvzf Quixote-2.4.tar.gz 3. cd Quixote-2.4 4 python setup -q install 注意,这个时候,会有错误发生,说是创建usr/python2.3/quixote时没有权限,不管他,继续 5 在第4步的时候,安装程序已经执行了build,在Quixte-2.4下,有一个新建的目录:build。在build里面,会看到一个类似于lib.linuxi686的目录,在这个目录下,有一个quixote目录。现在要做的是把这里的quixote目录拷贝到我们自己的python目录下, 即/home/Y |
|
[Hibernate]UserType实例——User的Email列表 软件技术
lhwork 发表于 2007/2/2 17:25:56 |
1.实现UserType接口的EMailList自定义类型
import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Types; import java.util.ArrayList; import java.util.List;
import org.apache.commons.lang.StringUtils;
import net.sf.hibernate.Hibernate; import net.sf.hibernate.HibernateException; import net.sf.hibernate.UserType; import net.sf.hibernate.hql.Parser;
/** * @author hy-he * */< |
|
[Hibernate]Hibernate的自定义数据类型实现接口之一——UserType祥解 软件技术
lhwork 发表于 2007/2/2 17:25:29 |
import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException;
import net.sf.hibernate.HibernateException;
/** * @author hy-he * */ public interface UserType { /** * 返回UserType所映射字段的SQL类型(java.sql.Types) * 返回类型为int[],其中包含了映射个字段的SQL类型代码 * (UserType可以映射到一个或者多个字段) * @return */ public int[]sqlTypes(); /** * UserType.nullSafeGet()所返 |
|
|