Skip to main content

Abstract

JSON library for working with django + json

Donors

Installation

To install you can use pip:

pip install django-jsonify

Then add jsonify to django settings.INSTALLED_APPS

Usage

If you want to convert varianble in django template, you can use jsonify filter:

{% load jsonify %}

{% block content %} <script type="text/javascript">
    <![CDATA[ var items = {{ items|jsonify }}; ]]></script>
{% endblock %}

If you want to return JSON data from view, you can use @ajax_request decorator

from jsonify.decorators import ajax_request

@ajax_request
def my_view(request):
    news = News.objects.all()
    news_titles = [entry.title for entry in news]
    return {'news_titles': news_titles}

Download files

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

Source Distribution

django-jsonify-0.3.0.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file django-jsonify-0.3.0.tar.gz.

File metadata

File hashes

Hashes for django-jsonify-0.3.0.tar.gz
Algorithm Hash digest
SHA256 51d7cb8cb5e1fd4b32b76b4e200833f499aad5b01feb2de8c1e3b3507f1bbbc4
MD5 0a24c603511ca8bb1200ef3515fe3688
BLAKE2b-256 cad4c8dc84ffb33b1dcb969d3db0715b92dc9d662eb7cb722fc919a42a57d77e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 file

0.2.1

1 file

0.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page