Skip to main content

A Simple json renderer for django.

Project description

A Simple json renderer for django.


pip install django-json-renderer



Native Django JsonResponse (or it’s polyfill).


Inherit from DjangoJSONEncoder, extends the parser of QuerySet (using list(queryset.values())) and Models (using model_to_dict).

render_json(encoder=ModelJSONEncoder, safe=True, **kwargs)

Return the decorator that convert json-serializable to JsonResponse (using ModelJSONEncoder as default). encoder and safe params has the same meaning as Django JsonResponse.


from django.db import models
from django_json_encoder import render_json

class Person(models.Model):
    first_name = models.CharField(max_length=30)
    last_name = models.CharField(max_length=30)

def get_first_person(request):
    return Person.objects.all().first()

## `safe` params
def get_all_person(request):
    return Person.objects.all()



Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-json-renderer-0.1.2.tar.gz (2.4 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page