This allows Django to pass data to the browser.
Project description
Django Client Data
==================
This allows Django to pass data to the browser.
Installation
------------
To get the latest stable release from PyPi
.. code-block:: bash
pip install django_client_data
Add ``django_client_data`` to your ``INSTALLED_APPS``
.. code-block:: python
INSTALLED_APPS = (
...,
'django_client_data',
)
Install middleware.
Install context processor.
Usage
-----
Call ``set_client_data()``.
Include ``client_data.html`` in your page.
Settings
--------
CLIENT_DATA_NAMESPACE, defaults to 'DJANGO', the data is a property of this name
named 'client_data'.
Mechanism
---------
Django Client Data works by attaching a ``client_data`` attribute on the request
object. The ``client_data.html`` template attaches a ... to the JavaScript
global indicated by CLIENT_DATA_NAMESPACE.
Todo
----
* add a "context processors" feature to client data so custom values can be
injected
Run Tests
---------
.. code-block:: bash
./configure.sh
source venv/bin/activate
python manage.py test
==================
This allows Django to pass data to the browser.
Installation
------------
To get the latest stable release from PyPi
.. code-block:: bash
pip install django_client_data
Add ``django_client_data`` to your ``INSTALLED_APPS``
.. code-block:: python
INSTALLED_APPS = (
...,
'django_client_data',
)
Install middleware.
Install context processor.
Usage
-----
Call ``set_client_data()``.
Include ``client_data.html`` in your page.
Settings
--------
CLIENT_DATA_NAMESPACE, defaults to 'DJANGO', the data is a property of this name
named 'client_data'.
Mechanism
---------
Django Client Data works by attaching a ``client_data`` attribute on the request
object. The ``client_data.html`` template attaches a ... to the JavaScript
global indicated by CLIENT_DATA_NAMESPACE.
Todo
----
* add a "context processors" feature to client data so custom values can be
injected
Run Tests
---------
.. code-block:: bash
./configure.sh
source venv/bin/activate
python manage.py test
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django_client_data-0.1.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for django_client_data-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69e4dc272a95e7c806c74ef05d6e47eaf5f783e57d5ae1a295762346c3a19f8b |
|
MD5 | 520f3e4b428a920a912a564bfd948db1 |
|
BLAKE2b-256 | 92909c92a36b67a6d5546f2ab4a9b581e7d3c227470787e68261353ce9ccf58f |