Skip to content

Commit 17a2a67

Browse files
delsimMark Gibbs
and
Mark Gibbs
authored
Add checklist for bootstrap installation (#255)
* Add checklist for bootstrap installation * Increment version to 1.4.1 Co-authored-by: Mark Gibbs <[email protected]>
1 parent 6b2c3cd commit 17a2a67

File tree

5 files changed

+40
-4
lines changed

5 files changed

+40
-4
lines changed

README.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Then, add `django_plotly_dash` to `INSTALLED_APPS` in your Django `settings.py`
3838
]
3939

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

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

5050
For the final installation step, a migration is needed to update the
51-
database::
51+
database:
5252

5353
./manage.py migrate
5454

55-
Note that this package requires version 2.0 or greater of Django, due to the use of the `path` function for registering routes.
55+
If using version 3.0 or later of Django, then the use of frames within
56+
HTML documents has to be enabled by adding to the ``settings.py`` file:
57+
58+
X_FRAME_OPTIONS = 'SAMEORIGIN'
59+
5660

5761
Further configuration, including live updating to share application
5862
state, is described in the [online documentation](https://django-plotly-dash.readthedocs.io/en/latest/).

django_plotly_dash/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
2424
'''
2525

26-
__version__ = "1.4.0"
26+
__version__ = "1.4.1"

docs/bootstrap.rst

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.. _bootstrap:
2+
3+
Using Bootstrap
4+
===============
5+
6+
The ``django-plotly-dash`` package is frequently used with the ``dash-bootstrap-components`` package, and this
7+
requires a number of steps to set up correctly.
8+
9+
This section is
10+
a checkist of the required confiuration steps.
11+
12+
- install the package as descrbed in the :ref:`installation <installation>` section
13+
14+
- add the various settings in the :ref:`configuration <configuration>` section, particularly
15+
the STATICFILES_FINDERS, PLOTLY_COMPONENTS and MIDDLEWARE ones.
16+
17+
- install django-bootstrap 4 with ``pip install django-bootstrap4`` and add ``bootstrap4`` to INSTALLED_APPS in the
18+
project's ``settings.py`` file
19+
20+
- make sure that the settings for serving static files are set correctly, particularly STATIC_ROOT, as
21+
described in the Django `documentation <https://docs.djangoproject.com/en/3.0/howto/static-files/>`_
22+
23+
- use the ``prepare_demo`` script or perform the equivalent steps, paricularly the ``migrate`` and ``collectstatic`` steps
24+
25+
- make sure ``add_bootstrap_links=True`` is set for apps using ``dash-bootstrap-components``
26+
27+
- the Django documentation `deployment <https://docs.djangoproject.com/en/3.0/howto/static-files/deployment/>`_ section
28+
covers setting up the serving of static files for production

docs/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Contents
2424
dash_components
2525
configuration
2626
local_assets
27+
bootstrap
2728
demo_notes
2829
access_control
2930
faq

docs/installation.rst

+3
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ available options are detailed in the :ref:`configuration <configuration>` secti
9898

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

101+
A checklist for using ``dash-bootstrap-components`` can be found
102+
in the :ref:`bootstrap <bootstrap>` section.
103+
101104
Source code and demo
102105
--------------------
103106

0 commit comments

Comments
 (0)