Skip to main content

django-includes

Experimental software. There is no tests, no documentation, use it are your own risks (or don’t).

Currently testing that with django 2 and python 3.5+ only, which will be the only supported target.

Install

  • Add ‘django_includes’ to INSTALLED_APPS.

  • Add DjangoIncludesExtension to Jinja2 environment.

from django_includes.jinja2 import DjangoIncludesExtension

def environment(**options):
    env = Environment(**options)

    # your logic here

    env.add_extension(DjangoIncludesExtension)

    return env
  • Use {{ render_sync(request, ‘mused.views.MusicGroupListView’, musicgenre=object) }} in templates.

Now, that’s only the “synchronous render”,

Install hinclude

If you wanna use hinclude (a simple javascript that loads asynchronously some part of your page):

Add hinclude url to your project:

from django_includes.views import include_view

urlpatterns += [
    path('hinclude/<token>', include_view, kwargs={'via': 'hinclude'}, name='hinclude')
]

Add hinclude to your layout

<html lang="en" xmlns:hx="http://purl.org/NET/hinclude">
<head>
    <script src="{{ static('hinclude.js') }}"></script>
  • Use {{ render_hinclude(request, ‘mused.views.MusicGroupListView’, musicgenre=object) }} in templates.

Note that this will use json web tokens to encode the parameters, using your django secret as a “seed” for encryption.

Metadata

Release files for django-includes 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 django-includes 1.0.0
File Size Uploaded Provenance
django_includes-1.0.0.tar.gz 11.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 24.4 kB

Release files / django_includes-1.0.0.tar.gz

Download URL django_includes-1.0.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1646991c8998a8f6a4c0f7cd8132ba41d2610f797e360eaf4f889a1a6de14dae
BLAKE2b-256 checksum
How to use checksums
caf01e41dce9f73daa6841f63fb16251b315c8490ce1d7d20fcbd6b9c9214321
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.1 Darwin/21.6.0

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

Download URL django_includes-1.0.0-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e15227e33cfce7be7f5c294ddce722d57a7a9a48b12db1aaf995735bc7c9c0d
BLAKE2b-256 checksum
How to use checksums
1161b650c74addf9d00bf765e98b38098cced2eabaa42e9aa9095c8c9d2fb7bd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.1 Darwin/21.6.0

Security for django-includes 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