diff --git a/README.md b/README.md index b92d60f9..efb62e9d 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ templates: ```jinja2 {% load plotly_dash %} -{% plotly_item name="SimpleExample" %} +{% plotly_app name="SimpleExample" %} ``` The registration code needs to be in a location diff --git a/django_plotly_dash/__init__.py b/django_plotly_dash/__init__.py index 308c0945..27115947 100644 --- a/django_plotly_dash/__init__.py +++ b/django_plotly_dash/__init__.py @@ -6,6 +6,6 @@ and enables it to be served as part of a Django application. ''' -__version__ = "0.5.0" +__version__ = "0.5.1" from .dash_wrapper import DjangoDash diff --git a/django_plotly_dash/templates/django_plotly_dash/plotly_item.html b/django_plotly_dash/templates/django_plotly_dash/plotly_app.html similarity index 100% rename from django_plotly_dash/templates/django_plotly_dash/plotly_item.html rename to django_plotly_dash/templates/django_plotly_dash/plotly_app.html diff --git a/django_plotly_dash/templatetags/plotly_dash.py b/django_plotly_dash/templatetags/plotly_dash.py index 40effe62..b0c97b17 100644 --- a/django_plotly_dash/templatetags/plotly_dash.py +++ b/django_plotly_dash/templatetags/plotly_dash.py @@ -11,7 +11,7 @@ ws_default_url = "/%s" % pipe_ws_endpoint_name() -@register.inclusion_tag("django_plotly_dash/plotly_item.html", takes_context=True) +@register.inclusion_tag("django_plotly_dash/plotly_app.html", takes_context=True) def plotly_app(context, name=None, slug=None, da=None, ratio=0.1, use_frameborder=False): 'Insert a dash application using a html iframe' diff --git a/docs/installation.rst b/docs/installation.rst index dc914095..d366cdaa 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -36,7 +36,7 @@ database:: ./manage.py migrate -The ``plotly_item`` tag in the ``plotly_dash`` tag library can then be used to render any registered dash component. See :ref:`simple_use` for a simple example. +The ``plotly_app`` tag in the ``plotly_dash`` tag library can then be used to render any registered dash component. See :ref:`simple_use` for a simple example. It is important to ensure that any applications are registered using the ``DjangoDash`` class. This means that any python module containing the registration code has to be known to Django and loaded at the appropriate time. An easy way to ensure this is to import these modules into a standard Django file loaded at registration time. diff --git a/docs/simple_use.rst b/docs/simple_use.rst index b8cd82c9..52789c58 100644 --- a/docs/simple_use.rst +++ b/docs/simple_use.rst @@ -56,7 +56,7 @@ in :ref:`templates `: {%load plotly_dash%} - {%plotly_item name="SimpleExample"%} + {%plotly_app name="SimpleExample"%} Direct use in this manner, without any application state or use of live updating, is equivalent to inserting an ``iframe`` containing the diff --git a/docs/template_tags.rst b/docs/template_tags.rst index c49be473..ce8a14c0 100644 --- a/docs/template_tags.rst +++ b/docs/template_tags.rst @@ -18,7 +18,7 @@ Importing the ``plotly_dash`` library provides the ``plotly_app`` template tag: {%load plotly_dash%} - {%plotly_item name="SimpleExample"%} + {%plotly_app name="SimpleExample"%} This tag inserts a ``DjangoDash`` app within a page as a responsive ``iframe`` element. @@ -45,7 +45,7 @@ This template tag has to be inserted on every page that uses live updating: {%load plotly_dash%} - {%plotly_item ... DjangoDash instances using live updating ... %} + {%plotly_app ... DjangoDash instances using live updating ... %} {%plotly_message_pipe%}