Skip to content

Instantly share code, notes, and snippets.

@huacnlee
Created August 3, 2010 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huacnlee/505607 to your computer and use it in GitHub Desktop.
Save huacnlee/505607 to your computer and use it in GitHub Desktop.
# -*- 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