Skip to main content

Djld

Structured data with Django

Latest Version codecov Build Status License: MIT

Installation

pip install djld

Configuration

Add djld to your INSTALLED_APPS in settings.py, you can specify the folder containing your structured data overriding the LD_JSON_PATH variable

Usage

To render structured data in your templates you need the structured_data template tag

{% load djld %}

{% structured_data 'mydata.json' %}

You can use Django template sintax in your json files, and pass a context to the template tag

render(request, 'myapp/index.html', {
    'user_data' : {
        'url' : 'https://lotrek.it',
        'name' : 'Human Before Digital'
    }
})
{% load djld %}

{% structured_data 'mydata.json' user_data %}

You can also render a structured data from a dictionary, without using templates

render(request, 'myapp/index.html', {
    'user_data' : {
        'url' : 'https://lotrek.it',
        'name' : 'Human Before Digital'
    }
})
{% load djld %}

{% structured_data user_data %}

Run tests

$ pip install -r requirements-dev.txt
$ make test

Metadata

Release files for djld 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for djld 1.0.0
File Size Uploaded Provenance Actions
djld-1.0.0.tar.gz 3.7 kB Without provenance Details for djld-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for djld 1.0.0
File Interpreter ABI Platform Actions
djld-1.0.0-py3-none-any.whl Python 3 none any Details for djld-1.0.0-py3-none-any.whl

Total release size: 8.7 kB

Release files / djld-1.0.0.tar.gz

Download URL djld-1.0.0.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c7707231859efc055b50943dc35f10a562b1d3a56934c16cac9248540aa27e99
BLAKE2b-256 checksum
How to use checksums
7e1c496ae6e9a0d32f8e0eeb78759872b80f861c1cd8d54fb04311ec36e1f408
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/18.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.0

Release files / djld-1.0.0-py3-none-any.whl

Download URL djld-1.0.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
927967dc3840090eccded6002532550669a0ac905d7ac3312bd5ab79f3e77369
BLAKE2b-256 checksum
How to use checksums
f28c29c19960606eacff39e28ef25b3253934b0e11416d12338c220a8f2ea7e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/18.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.0

Security for djld 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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