Login

Snippets by bryanpieper

Snippet List

View Redirect Decorators

Temporary and permanent view redirect decorators. Simplifies views that always redirect to a specific or configured url. You can use the reverse() function (or any other runtime-required lookup) via `lambda` to define the redirect url.

  • view
  • decorator
  • redirects
Read More

JSON View Decorator

Django JSON view decorator. Dumps the object returned from the view function. Allows you to customize the JSON dumps() function using the available keyword arguments available from the simplejson module. By default, indents the output with 4 characters.

  • json
  • decorator
Read More

bryanpieper has posted 2 snippets.