django-easy

A small Django app to provide shortcuts


License
BSD-3-Clause
Install
pip install django-easy==0.1

Documentation

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!"