| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Tue, 23 Dec 2025 00:32:05 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100110021335
location: https://web.archive.org/web/20100110021335/https://github.com/simonw/django-signed
server-timing: captures_list;dur=0.937234, exclusion.robots;dur=0.087369, exclusion.robots.policy;dur=0.070883, esindex;dur=0.013231, cdx.remote;dur=7.608186, LoadShardBlock;dur=193.101027, PetaboxLoader3.datanode;dur=94.990765, PetaboxLoader3.resolve;dur=82.389953
x-app-server: wwwb-app246-dc8
x-ts: 302
x-tr: 226
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app246; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Tue, 23 Dec 2025 00:32:06 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Sun, 10 Jan 2010 02:13:35 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "a37254c60fdc7234e60adf247a2e13fe"
x-archive-orig-x-runtime: 82ms
x-archive-orig-content-length: 22028
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 10 Jan 2010 02:13:35 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_13_20100109204637_crawl103_IndexOnly-c/51_13_20100110021307_crawl101.arc.gz
server-timing: captures_list;dur=0.426270, exclusion.robots;dur=0.012545, exclusion.robots.policy;dur=0.005046, esindex;dur=0.006508, cdx.remote;dur=13.497327, LoadShardBlock;dur=153.868453, PetaboxLoader3.datanode;dur=131.683426, PetaboxLoader3.resolve;dur=164.871655, load_resource;dur=181.329408
x-app-server: wwwb-app246-dc8
x-ts: 200
x-tr: 419
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
simonw's django-signed at master - GitHub
simonw / django-signed
- Source
- Commits
- Network (3)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
-
Branches (2)
- json-not-pickle
- master ✓
- Tags (0)
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun Dec 06 09:37:33 -0800 2009 | Ignore my virtualenv [simonw] |
| |
README | Mon Oct 12 09:55:43 -0700 2009 | Documented baseconv.py in the readme, and renam... [simonw] |
| |
django_signed/ | Mon Oct 12 10:18:42 -0700 2009 | First attempt at turning signing code in to a S... [simonw] |
| |
examples/ | Sat Sep 26 02:27:03 -0700 2009 | Added initial implementation (extracted from dj... [simonw] |
README
django_signed
=============
This project demonstrates a proposed signing API for Django. You can run the
test suite like so:
cd examples
./manage.py test
The API is under heavy development. It is described in more detail here:
https://code.djangoproject.com/wiki/Signing
The mailing list discussion is here:
https://groups.google.com/group/django-developers/browse_thread/thread/133509246caf1d91
TODO:
- Add support for expiring signatures
- Try using a class instead of functions, as suggested by Johannes Dollinger
- Cookie signing functions
- Middleware that illustrates the proposed request cookie signing API
- Support key migration from an OLD_SECRET_KEY to the current one
baseconv.py
-----------
Part of this module is baseconv.py, which I hope to contribute to
django.utils. baseconv allows you to convert between integers and various
different string representations of those numbers. For example:
>>> import baseconv
>>> i = 102971
>>> baseconv.base2.from_int(i)
'11001001000111011'
>>> baseconv.base16.from_int(i)
'1923B'
>>> baseconv.base36.from_int(i)
'27gb'
>>> baseconv.base62.from_int(i)
'Qmp'
You can convert back again using the to_int(string) method:
>>> baseconv.base2.to_int('11001001000111011')
102971
>>> baseconv.base16.to_int('1923B')
102971
>>> baseconv.base36.to_int('27gb')
102971
>>> baseconv.base62.to_int('Qmp')
102971
This is principally useful as a compression scheme for transmitting numbers as
ascii text - in particular for URLs (URL shortening services such as bit.ly
use this technique). The signed cookie implementation uses this to represent
a unix timestamp in as few characters as possible, to keep cookie lengths
down.
If you wish to use your own shortening scheme you can use the BaseConvertor
class. For example, you might want to just use characters that aren't easily confused with each other - the alphabet
omitting i, l and o:
>>> convertor = baseconv.BaseConverter('abcdefghjkmnpqrstuvwxyz')
>>> convertor.from_int(102971)
'jmsa'
>>> convertor.to_int('jmsa')
102971
This feature is coming soon. Sit tight!
