Created
August 3, 2010 00:53
-
-
Save huacnlee/505607 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import md5 | |
def md5_encode(str): | |
u""" | |
summary: | |
MD5 encode | |
author: | |
Jason Lee <huacnlee@gmail.com> | |
""" | |
return md5.new(str).hexdigest() | |
def get_referer_url(request): | |
""" | |
summary: | |
get request referer url address,default / | |
author: | |
Jason Lee <huacnlee@gmail.com> | |
""" | |
return request.META.get('HTTP_REFERER', '/') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment