Skip to content

Commit

Permalink
Add checklist for bootstrap installation (#255)
Browse files Browse the repository at this point in the history
* Add checklist for bootstrap installation

* Increment version to 1.4.1

Co-authored-by: Mark Gibbs <mark@gibbs.consulting>
  • Loading branch information
delsim and Mark Gibbs committed Jun 21, 2020
1 parent 6b2c3cd commit 17a2a67
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Then, add `django_plotly_dash` to `INSTALLED_APPS` in your Django `settings.py`
]

The application's routes need to be registered within the routing structure by an appropriate ``include`` statement in
a ``urls.py`` file::
a ``urls.py`` file:

urlpatterns = [
...
Expand All @@ -48,11 +48,15 @@ a ``urls.py`` file::
The name within the URL is not important and can be changed.

For the final installation step, a migration is needed to update the
database::
database:

./manage.py migrate

Note that this package requires version 2.0 or greater of Django, due to the use of the `path` function for registering routes.
If using version 3.0 or later of Django, then the use of frames within
HTML documents has to be enabled by adding to the ``settings.py`` file:

X_FRAME_OPTIONS = 'SAMEORIGIN'


Further configuration, including live updating to share application
state, is described in the [online documentation](https://django-plotly-dash.readthedocs.io/en/latest/).
Expand Down
2 changes: 1 addition & 1 deletion django_plotly_dash/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
'''

__version__ = "1.4.0"
__version__ = "1.4.1"
28 changes: 28 additions & 0 deletions docs/bootstrap.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.. _bootstrap:

Using Bootstrap
===============

The ``django-plotly-dash`` package is frequently used with the ``dash-bootstrap-components`` package, and this
requires a number of steps to set up correctly.

This section is
a checkist of the required confiuration steps.

- install the package as descrbed in the :ref:`installation <installation>` section

- add the various settings in the :ref:`configuration <configuration>` section, particularly
the STATICFILES_FINDERS, PLOTLY_COMPONENTS and MIDDLEWARE ones.

- install django-bootstrap 4 with ``pip install django-bootstrap4`` and add ``bootstrap4`` to INSTALLED_APPS in the
project's ``settings.py`` file

- make sure that the settings for serving static files are set correctly, particularly STATIC_ROOT, as
described in the Django `documentation <https://docs.djangoproject.com/en/3.0/howto/static-files/>`_

- use the ``prepare_demo`` script or perform the equivalent steps, paricularly the ``migrate`` and ``collectstatic`` steps

- make sure ``add_bootstrap_links=True`` is set for apps using ``dash-bootstrap-components``

- the Django documentation `deployment <https://docs.djangoproject.com/en/3.0/howto/static-files/deployment/>`_ section
covers setting up the serving of static files for production
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Contents
dash_components
configuration
local_assets
bootstrap
demo_notes
access_control
faq
Expand Down
3 changes: 3 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ available options are detailed in the :ref:`configuration <configuration>` secti

This includes arranging for Dash assets to be served using the Django ``staticfiles`` functionality.

A checklist for using ``dash-bootstrap-components`` can be found
in the :ref:`bootstrap <bootstrap>` section.

Source code and demo
--------------------

Expand Down

0 comments on commit 17a2a67

Please sign in to comment.