Nginx is an amazing little web server that can do a lot of work for you so that you don't have to!. Why worry about signing and unsigning requests when your web server can handle that for you. Now you don't have to.
This simple library allows you to sign requests as required by the Nginx Secure Link module.
>>> pip install nginx_signing
The following example shows you how to sign an entire uri as documented in the nginx configuration here
>>> from nginx_signing.signing import UriSigner
>>> signer = UriSigner(SECRET_KEY)
>>> signer.sign('http://gjcourt.com')
'http://gjcourt.com?&st=uDqsQqA_ysTYR_bUdMUAGw&e=1365903669'
You can do more complex things. Say for example you only wanted to sign on a specific query string argument.
>>> from nginx_signing.signing import UriQuerySigner
>>> signer = UriQuerySigner(SECRET_KEY)
>>> signer.sign('url', quote('http://gjcourt/com/', safe=''))
'url=http%3A%2F%2Fgjcourt.com&st=5w5aZT_WaMY8LhvQL055gg&e=1365904071'
That's about it. Happy signing.