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
Install using pip:
pip install -U django-dict-response
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 redirectdefault: 'redirect_to'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-dict-response-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a14c87eb93a8b0f815320c590d3535ef9e80263ccdfdc737140e362727d0d4a |
|
MD5 | 82beaf99ecb6d58d557f3c2fdfec5962 |
|
BLAKE2b-256 | 9144ce1ac0fc077e682290c937157985d9822e480f513a08e9447abbab238c91 |