Repository: plotly/dash

Issue:
[BUG] fask.Blueprint name may not contain a '.' character
when passing `url_base_pathname="/user/jane.doe/"` to the `Dash` constructor, this ValueError is raised:

```
$ python
Python 3.10.2 | packaged by conda-forge | (main, Jan 14 2022, 08:02:09) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dash
>>> dash.__version__
'2.1.0'
>>> app = dash.Dash(__name__, url_base_pathname="/user/jane.doe/")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda-envs/envs/data-processing/lib/python3.10/site-packages/dash/dash.py", line 423, in __init__
    self.init_app()
  File "/opt/conda-envs/envs/data-processing/lib/python3.10/site-packages/dash/dash.py", line 450, in init_app
    flask.Blueprint(
  File "/opt/conda-envs/envs/data-processing/lib/python3.10/site-packages/flask/blueprints.py", line 197, in __init__
    raise ValueError("'name' may not contain a dot '.' character.")
ValueError: 'name' may not contain a dot '.' character.
>>> 
```

I have changed `dash.py` accordingly:

```
        assets_blueprint_name = "{}{}".format(
            config.routes_pathname_prefix.replace(".", "_").replace("/", "_"), "dash_assets"
        )
```

and it works. Sadly I couldn't find a document detailing all forbidden characters.
[BUG] fask.Blueprint name may not contain a '.' character
when passing `url_base_pathname="/user/jane.doe/"` to the `Dash` constructor, this ValueError is raised:

```
$ python
Python 3.10.2 | packaged by conda-forge | (main, Jan 14 2022, 08:02:09) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import dash
>>> dash.__version__
'2.1.0'
>>> app = dash.Dash(__name__, url_base_pathname="/user/jane.doe/")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda-envs/envs/data-processing/lib/python3.10/site-packages/dash/dash.py", line 423, in __init__
    self.init_app()
  File "/opt/conda-envs/envs/data-processing/lib/python3.10/site-packages/dash/dash.py", line 450, in init_app
    flask.Blueprint(
  File "/opt/conda-envs/envs/data-processing/lib/python3.10/site-packages/flask/blueprints.py", line 197, in __init__
    raise ValueError("'name' may not contain a dot '.' character.")
ValueError: 'name' may not contain a dot '.' character.
>>> 
```

I have changed `dash.py` accordingly:

```
        assets_blueprint_name = "{}{}".format(
            config.routes_pathname_prefix.replace(".", "_").replace("/", "_"), "dash_assets"
        )
```

and it works. Sadly I couldn't find a document detailing all forbidden characters.


Discussion:
The requirement was introduced by https://github.com/pallets/flask/commit/7c5261407dae61679c268b44c63d73909c3fe652, referring to https://github.com/pallets/flask/issues/4041
The requirement was introduced by https://github.com/pallets/flask/commit/7c5261407dae61679c268b44c63d73909c3fe652, referring to https://github.com/pallets/flask/issues/4041

Resolving patch:
diff --git a/dash/dash.py b/dash/dash.py
--- a/dash/dash.py
+++ b/dash/dash.py
@@ -443,7 +443,8 @@ def init_app(self, app=None, **kwargs):
             self.server = app
 
         assets_blueprint_name = "{}{}".format(
-            config.routes_pathname_prefix.replace("/", "_"), "dash_assets"
+            config.routes_pathname_prefix.replace("/", "_").replace(".", "_"),
+            "dash_assets",
         )
 
         self.server.register_blueprint(


Test patch: