useful shortcuts for django
Python
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
easy
LICENSE
README.md
README.rst
setup.py

README.md

###Django Easy some handy shortcuts for creating django views

###Installation

pip install django-easy

###Usage

# views.py
from easy.decorators import *

@context_template_response
def view_template(request):
  return "home.html"

@context_template_response
def view_template_with_vars(request):
  return "home.html", {'vars': 'foobar'}


@json_response
def view_simple_json_api(request):
  return {
    'foo': 'bar',
    'numbers': [1, 2, 3]
  }

@string_response
def view_some_text(request):
  return "hello world!"