Skip to main content

Include django views as a subparts of other django views, using either HTTP (with esi or hinclude) or direct render.

Project description

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.

  • 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>

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

Project details


Download files

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

Source Distribution

django_includes-0.2.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distributions

django_includes-0.2.0-py3.6.egg (12.3 kB view details)

Uploaded Source

django_includes-0.2.0-py3.5.egg (12.5 kB view details)

Uploaded Source

django_includes-0.2.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file django_includes-0.2.0.tar.gz.

File metadata

File hashes

Hashes for django_includes-0.2.0.tar.gz
Algorithm Hash digest
SHA256 80edfb997acd3885365d78679b6555903b2f3ccfd57ef81e8bffb089cc1d8ab1
MD5 ad9d39eaccc851f6ef554392867e4622
BLAKE2b-256 5aead55912fb469f3c6acfd00ab2ad8c28898ae59ca89a469c7cda64f3fbded4

See more details on using hashes here.

File details

Details for the file django_includes-0.2.0-py3.6.egg.

File metadata

File hashes

Hashes for django_includes-0.2.0-py3.6.egg
Algorithm Hash digest
SHA256 cf54d450f92223dc7393d9efef703c7008206a15f67ec505b29b32f0e1d9b5f0
MD5 084de3cbdcd1f1deeb9bd1a85af8ece5
BLAKE2b-256 88e08418b521a0fc69999cee07a05682b61495e96dcc49395f820be325d09890

See more details on using hashes here.

File details

Details for the file django_includes-0.2.0-py3.5.egg.

File metadata

File hashes

Hashes for django_includes-0.2.0-py3.5.egg
Algorithm Hash digest
SHA256 f87c5e859aaaf4672b90f066d1e972a74811fac89a0462ac68e61967d1d9cd59
MD5 e8433b7994f348c0bcb6855d401e7ac0
BLAKE2b-256 50b3695f38c58c91f3038d183ec4663c139fc3c10c2b2d0d22412137e25f275d

See more details on using hashes here.

File details

Details for the file django_includes-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_includes-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c978a650a95a6a51a777162a494a6cbf8590967ee9899902e8d19d6e6828827
MD5 9f1d9723184db33f0bc580b20443e11d
BLAKE2b-256 91150f67135e8a5d621d1e655a0dd31810450c68b59ceefdaa55eb63c655a340

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page