From 76ca5465d140132cb2fc737ecab5a809971bdd02 Mon Sep 17 00:00:00 2001
From: Brylie Christopher Oxley <brylie@amble.fi>
Date: Fri, 14 May 2021 15:21:02 +0300
Subject: [PATCH] Clarify the importance of registering plotly app (#335)

---
 docs/installation.rst | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/docs/installation.rst b/docs/installation.rst
index c29828b..063941c 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -15,7 +15,7 @@ Then, add ``django_plotly_dash`` to ``INSTALLED_APPS`` in the Django ``settings.
         ...
         'django_plotly_dash.apps.DjangoPlotlyDashConfig',
         ...
-        ]
+    ]
 
 The project directory name ``django_plotly_dash`` can also be used on its own if preferred, but this will stop the use of readable application names in
 the Django admin interface.
@@ -49,9 +49,15 @@ database::
 
     ./manage.py migrate
 
-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.
+
+.. note::
+    An easy way to ensure the Plotly app is to import it into ``views.py`` or ``urls.py`` as in the following example,
+    which assumes the ``plotly_app`` module (``plotly_app.py``) is located in the same folder as ``views.py``::
+
+    from . import plotly_app
 
-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.
+Once your Plotly app is registered, ``plotly_app`` tag in the ``plotly_dash`` tag library can then be used to render it as a dash component. See :ref:`simple_use` for a simple example.
 
 Extra steps for live state
 --------------------------
-- 
GitLab