Skip to content

Commit ade40bb

Browse files
delsimGibbsConsulting
authored andcommitted
Add online demo info to documentation and readme (#156)
* Add online demo info to documentation and readme * Change serve_locally default to always be false (#155) * Add online demo info to documentation and readme
1 parent fd19d80 commit ade40bb

File tree

5 files changed

+17
-23
lines changed

5 files changed

+17
-23
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ More detailed information
2020
can be found in the online documentation at
2121
<https://readthedocs.org/projects/django-plotly-dash>
2222

23+
An online version of the demo can be found at <https://djangoplotlydash.com>
24+
2325

2426
## Installation
2527

@@ -49,7 +51,7 @@ For the final installation step, a migration is needed to update the
4951
database::
5052

5153
./manage.py migrate
52-
54+
5355
Note that this package requires version 2.0 or greater of Django, due to the use of the `path` function for registering routes.
5456

5557
Further configuration, including live updating to share application

docs/demo_notes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ the `github repository <https://github.com/GibbsConsulting/django-plotly-dash/tr
2121
There is a more details walkthrough of the :ref:`session state storage <session_example>` example. This example also
2222
shows the use of `dash bootstrap components <https://pypi.org/project/dash-bootstrap-components/>`_.
2323

24+
The demo application can also be viewed `online <https://djangoplotlydash.com>`_.
25+
26+
2427
.. _session_example:
28+
2529
Session state example walkthrough
2630
---------------------------------
2731

docs/development.rst

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,9 @@ the :ref:`configuration <configuration>` of the host and port for channels is se
4242
the Django project.
4343

4444
During development, it can be convenient to serve the ``Dash`` components
45-
locally. Passing ``serve_locally=True`` to a ``DjangoDash`` constructor will cause all of the
45+
locally. Whilst passing ``serve_locally=True`` to a ``DjangoDash`` constructor will cause all of the
4646
css and javascript files for the components in that application from the
47-
local server. Additional Django settings are also needed to serve the
48-
static files::
49-
50-
STATIC_URL = '/static/'
51-
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
52-
53-
STATICFILES_DIRS = [] # Or other sources as needed
54-
55-
if DEBUG:
56-
57-
import importlib
58-
59-
for dash_module_name in ['dash_core_components',
60-
'dash_html_components',
61-
'dash_renderer',
62-
'dpd_components',
63-
]:
64-
65-
module = importlib.import_module(dash_module_name)
66-
STATICFILES_DIRS.append(("dash/%s"%dash_module_name, os.path.dirname(module.__file__)))
47+
local server, it is recommended to use the global ``serve_locally`` configuration setting.
6748

6849
Note that it is not good practice to serve static content in production through Django.
6950

docs/faq.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,8 @@ No, it is needed. Consider this example (it is part of ``demo-nine``):
5656
The first ``Img`` will have its source file correctly served up by Django as a standard static file. However, the second image will
5757
not be rendered as the path will be incorrect.
5858

59-
See the :ref:`local_assets` section for more information on `configuration` with local assets.
59+
See the :ref:`local_assets` section for more information on configuration with local assets.
60+
61+
* Is there a live demo available?
62+
63+
Yes. It can be found `here <https://djangoplotlydash.com>`_

docs/introduction.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ these features:
1515
There is nothing here that cannot be achieved through expanding the Flask app around Plotly Dash, or indeed by using an alternative web
1616
framework. The purpose of this project is to enable the above features, given that the choice to use Django has already been made.
1717

18+
The source code can be found in `this github repository <https://https://github.com/GibbsConsulting/django-plotly-dash>`_. This repository also includes
19+
a self-contained demo application, which can also be viewed `online <https://djangoplotlydash.com>`_.
20+
1821
.. _overview:
1922

2023
Overview

0 commit comments

Comments
 (0)