django-includes-0.3.1
توضیحات
Include django views as a subparts of other django views, using either HTTP (with esi or hinclude) or direct render.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | django-includes-0.3.1 |
| نام | django-includes |
| نسخه کتابخانه | 0.3.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Romain Dorgueil |
| ایمیل نویسنده | romain@dorgueil.net |
| آدرس صفحه اصلی | https://github.com/hartym/django-includes |
| آدرس اینترنتی | https://pypi.org/project/django-includes/ |
| مجوز | Apache License, Version 2.0 |
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.
.. code-block:: python
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:
.. code-block:: python
from django_includes.views import include_view
urlpatterns += [
path('hinclude/<token>', include_view, kwargs={'via': 'hinclude'}, name='hinclude')
]
Add hinclude to your layout
.. code-block:: html
<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.
نیازمندی
| مقدار | نام |
|---|---|
| ~=0.12 | CacheControl |
| ~=1.5 | PyJWT |
| <4.0,>=2.0 | django |
| ~=2.10 | jinja2 |
| ~=2.18 | requests |
| ~=4.5 | coverage |
| - | isort |
| ~=4.6 | pytest |
| ~=2.7 | pytest-cov |
نحوه نصب
نصب پکیج whl django-includes-0.3.1:
pip install django-includes-0.3.1.whl
نصب پکیج tar.gz django-includes-0.3.1:
pip install django-includes-0.3.1.tar.gz