From 29285e7ec56bb199b9beb22ce0be5aaf79334612 Mon Sep 17 00:00:00 2001 From: Mark Gibbs <delsim@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:53:36 -0800 Subject: [PATCH] Make compatible with latest Flask and Dash releases (#429) * Make compatible with latest Flask and Dash releases * Bump version to 2.1.3 Co-authored-by: delsim <dev@gibbsconsulting.ca> --- dev_requirements.txt | 4 +--- django_plotly_dash/dash_wrapper.py | 6 +++++- django_plotly_dash/version.py | 2 +- requirements.txt | 4 ++-- setup.py | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index cab4691..6ff9bc3 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,11 +1,9 @@ asgiref -attrs==19.3.0 +attrs coveralls>=1.6.0 -channels>=2.0 channels-redis daphne dash-bootstrap-components -Django>=2.0 django-bootstrap4 django-redis dpd-static-support>=0.0.4 diff --git a/django_plotly_dash/dash_wrapper.py b/django_plotly_dash/dash_wrapper.py index b408be9..7d13954 100644 --- a/django_plotly_dash/dash_wrapper.py +++ b/django_plotly_dash/dash_wrapper.py @@ -375,10 +375,12 @@ class DjangoDash: class PseudoFlask(Flask): 'Dummy implementation of a Flask instance, providing stub functionality' def __init__(self): - self.config = {} + self.config = {'DEBUG': False} self.endpoints = {} self.name = "PseudoFlaskDummyName" self.blueprints = {} + self._got_first_request = False + self.before_request_funcs = {} # pylint: disable=unused-argument, missing-docstring @@ -425,6 +427,8 @@ class WrappedDash(Dash): kwargs['url_base_pathname'] = self._base_pathname kwargs['server'] = self._notflask + #xkwargs['DEBUG'] = kwargs.get('DEBUG', False) + super().__init__(__name__, **kwargs) self.css.config.serve_locally = serve_locally diff --git a/django_plotly_dash/version.py b/django_plotly_dash/version.py index 200e795..b47a37d 100644 --- a/django_plotly_dash/version.py +++ b/django_plotly_dash/version.py @@ -23,4 +23,4 @@ SOFTWARE. ''' -__version__ = "2.1.2" +__version__ = "2.1.3" diff --git a/requirements.txt b/requirements.txt index 8907f73..9430bc5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ dpd-components dash-bootstrap-components -channels<3.0 +channels>=2.0 Django>=2.2,<4.0.0 Flask>=1.0.2 -Werkzeug>=2.0,<2.1 +Werkzeug diff --git a/setup.py b/setup.py index 8ce566e..fecdd90 100644 --- a/setup.py +++ b/setup.py @@ -46,10 +46,10 @@ setup( 'dash-bootstrap-components', - 'channels<3.0', + 'channels>=2.0', 'Django>=2.2,<4.0.0', 'Flask>=1.0.2', - 'Werkzeug>=2.0,<2.1', + 'Werkzeug', ], python_requires=">=3.8", ) -- GitLab