Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Django Dict Response

Project Description

Overview

Write views.py simply.

Usage

Before:

from django.shortcuts import redirect, render

def view(request):
    ...
    if request.method == 'POST':
        ...
        return redirect(url)
    response = render(request, template_name, dict(obj=obj, title=title), status=200)
    response['Age'] = 120
    return response

After:

def view(request):
    ...
    if request.method == 'POST':
        ...
        return {'redirect_to': [url]}
    return dict(Age=120, obj=obj, template_name=template_name, title=title, status=200)

Installation

  1. Install using pip:

    pip install -U django-dict-response

  2. Add to last of MIDDLEWARE_CLASSES in your settings.py:

    'django_dict_response.middlewares.DictResponseMiddleware',

Dependencies

Django >= 1.7

Configuration

  • REDIRECT_KEY

    The setting is used when redirect
    default: 'redirect_to'
Release History

Release History

This version
History Node

0.0.8

History Node

0.0.7

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-dict-response-0.0.8.tar.gz (2.5 kB) Copy SHA256 Checksum SHA256 Source Apr 19, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting