Monthly Archives: June 2012

读余光中《寻李白》有感而作

酒在哪?剑在哪?
长啸一声,便是那狂,便是那痴
列子御风,我辈又岂草履于世?
庄周梦蝶,晓梦之中,既是那蝶,也欲冲破浩瀚九天
错它个破碎
笑它个七窍流血,断肠
做半个神仙,小半个妖怪
饮了那霸王的胆魄
牵着她易安的温柔
便是,那万面玲珑
活它个电脑,活它个睡觉,活它个出人头地,活它个人

附余光中先生《寻李白》:
Continue reading

fix STATIC_URL is empty in Django

When using static files in my Django application, the STATIC_URL is empty even I set it in the setting.py, after a few research, here is how I fixed it.

My static image files are located at movie/static/img (my application is movie)

1. in views.py

from django.template import RequestContext

if you use render_to_response, make sure you add context_instance=RequestContext(request) in it,

render_to_response('movie/index.html', {'movie_list': movie_list}, context_instance=RequestContext(request));

Continue reading

setup Django 1.4 on Godaddy linux economy host

In case you want to use Django framework in Godaddy’s Linux Economy Host, here is the steps:

1. Godaddy has virtualenv installed, so first, create a virtual environment venv: (I use $HOME/lib/ for all the installed stuff below)

cd ~/
mkdir lib
cd lib
virtualenv --no-site-packages venv

The python package folder is $HOME/lib/venv/lib/python2.7/site-packages

2. Install the latest Django through pip
pip install Django

Continue reading