详见以下页面: http://djangosnippets.org/snippets/815/ 转载于:https://www.cnblogs.com/johan/archive/2012/04/11/2442021.html