RestView - a class for creating a view that dispatches based on request.method
Blog de Simon Willison Posted on September 21, 2008
RestView—a class for creating a view that dispatches based on request.method (via). I finally got around to writing up a simple approach I’ve been using for REST-style view functions in Django that dispatch based on request.method.
Django snippets: Sign a string using SHA1, then shrink it using url-safe base65
Blog de Simon Willison Posted on August 27, 2008
Django snippets: Sign a string using SHA1, then shrink it using url-safe base65. I needed a way to create tamper-proof URLs and cookies by signing them, but didn’t want the overhead of a full 40 character SHA1 hash. After some experimentation, it turns out you can knock a 40 char hash down to 27 characters by encoding it using ...
Django snippets: Command to dump data as a python script
Blog de Simon Willison Posted on June 24, 2008
Django snippets: Command to dump data as a python script. Extremely useful—dumps the data for an application as an executable Python script which will re-import it in to another database without any risk of colliding with existing IDs, sorting out foreign keys along the way.


