为四川人民祈祷! www.onefoundation.cn
logo of kjam.org
Archive: 2009-3

MOD_WSGI 与 no such table

使用mod_wsgi的时候遇到了错误 OperationalError: no such table: django_session
开始还怪罪于mod_wsgi可能有未知bug

终于在google group里找到了问题所在
http://groups.google.com/group/django-users/browse_thread/thread/2d9f25383a97bc6e?pli=1

翻译一下:
出现这种问题最大的的可能是在设置DATABASE_NAME的时候没有使用绝对的路径,
如果sqlite3找不到数据库文件, 它会自己尝试创建一个空的数据库文件.

OK, 把settings.py中的数据库文件名换成绝对路径就OK了.
错怪了mod_wsgi, 现在看来mod_wsgi在hosting python项目的时候还是相当值得信赖的,
已经可以完全取代古老的fastcgi和mod_python技术, 成为apache的新一代贴身伴侣.

对于性能需求高的大型站点, 或许scgi仍然是不二选择, 服务器方面也轻装上阵, 忘掉apache选择lighttpd吧.



补充一点, 除了 sqlite 数据库以外, settings.py 中用到的路径在 mod_wsgi 下最好都不要使用相对路径, 比如 TEMPLATE_DIRS
comments: 1  
by kernel1983

游戏机

春节期间搞一游戏机, 经过了热恋期现在已经闲置

为了能发挥余热, 很想知道如何在上面写程序.
业余功课, 一时不知道如何开始.

记得软破游戏机的code名为softchip. OK, 搜索一下, 居然还hosting在我们熟悉的google code上面, cool.
softchip project

我对这个程序其实不感兴趣, 我感兴趣的是如何编译它.
查看源代码, 得到一些线索. 第一, 写代码的人用的是CDT, 也就是eclipse. 第二, 我找到了Makefile. 太好了, 是Makefile而不是automake.
查看Makefile

继续找线索, 开始我觉得应该是要找gcc的某些参数, 后来我发现了这个项目所依赖的环境, devkitppc.
顺藤摸瓜, 我们找还到了devkitpro

简单了解一下devkitpro, 这是一个可以为各种游戏机写程序的环境.
普及一下cpu: 电视主机wii, ngc用的是IBM的powerpc, 简称ppc, 前几年的苹果电脑也用ppc处理器. ndsl, gba这些都是用的arm. 最后是psp, 好像是日本的某种cpu, 是mips架构. 初步了解, devkitpro应该可以为以上的设备编程.

下载devkitppc, 惊喜的发现, 支持windows/linux/OSX三种平台.
comments: 0  
by kernel1983

Bye Bye 浪点

有朋友在Facebook跟我说, 站点不能访问. 很纳闷, 因为自己站点的代码最近可没有什么改动.

上去一看出错信息, 服务器上的django代码不全, sqlite3 backend 中的base.py文件找不到. 第一时间通过QQ向浪点的客服人员反应, --! 没理我.
大约半个小时后, 得到的回答是, 请加技术人员QQ. 我靠, 你还以为自己是政府机构呀!
加技术人员的QQ, 技术人员不在线.
当天晚上没有收到任何回复.

第二天中午想继续沟通. 令人惊奇的是, 当我再一次查看apache日志, 发现mod_python已经找不到python语言解释器了.
于是开始打电话, 经历过几次忙音以后, 电话终于接通.
工作人员跟我解释从昨晚他们就一直在加班, 服务器出现了比较严重的故障(当然是软件方面的).

于是我提出要和技术人员沟通, 他说请加技术人员QQ, 我要技术人员分机号码, 对方拒绝.
我说能不能给出一个修复的具体时间, 他们说没有时间表 ... 这下我可急了, 我说为什么不能让我联系技术人员, 我只是想帮助他们尽快解决问题, 这时, 客服人员沉默了, 我请他说话, 他把电话挂了.

不再相信浪点了

网站搬家到 ZoomType
comments: 34  
by kernel1983

more about my-todo

my-todo is a project based on Google App Engine and Gears.

Basically, it comes from experiment on Google Gears. Google Gears is a browser extension, which allows browsing site without network.

It first looks simple and ugly. And it's not as wide as normal web site. But soon I found it fits for the width of Firefox sidebar. Firefox has a sidebar for the bookmarks, and it also could be used for loading web pages.

I hacked some javascript so that when you add my-todo to the bookmark and click it, the page will be loaded in the sidebar.

I also found the width of page maybe fits for the mobile such as iPhone. I custom the page, it now looks great. I wished it would be OK for GPhone, but I can't test it.

The design philosophy I followed is KISS. And I know there are hundreds of similar project, strong and complex enough in the world. I love simple things, so I decide to never add 'friends' feature in the project.

But lots of friends see my project. They wish to share what they doing with friends.

Finally I decide to do it a new way, adding twitter feature in my-todo.
More and more like to micro blog their life. my-todo made the GTD and micro blogging together.

OK, that's the my-todo, for now. Maybe more features in the future.
comments: 0  
by kernel1983
1