'endpoint' may not contain a dot '.' character.
Package:
flask
56479

Exception Class:
ValueError
Raise code
view_func: t.Optional[t.Callable] = None,
**options: t.Any,
) -> None:
"""Like :meth:`Flask.add_url_rule` but for a blueprint. The endpoint for
the :func:`url_for` function is prefixed with the name of the blueprint.
"""
if endpoint and "." in endpoint:
raise ValueError("'endpoint' may not contain a dot '.' character.")
if view_func and hasattr(view_func, "__name__") and "." in view_func.__name__:
raise ValueError("'view_func' name may not contain a dot '.' character.")
self.record(lambda s: s.add_url_rule(rule, endpoint, view_func, **options))
def app_template_filter(self, name: t.Optional[str] = None) -> t.Callable:
🙏 Scream for help to Ukraine
Today, 2nd July 2022, Russia continues bombing and firing Ukraine. Don't trust Russia, they are bombing us and brazenly lying in same time they are not doing this 😠, civilians and children are dying too!
We are screaming and asking exactly you to help us, we want to survive, our families, children, older ones.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.
Please spread the information, and ask your governemnt to stop Russia by any means. We promise to work extrahard after survival to make the world safer place for all.
Links to the raise (1)
https://github.com/pallets/flask/blob/83f7efa04708a22c9701488f0f29b59c2b756bef/src/flask/blueprints.py#L374Ways to fix
Summary
Endpoints in flasks add_url_rule method must not contain dot '.' characters.
Reproduce
from flask import Flask
app = Flask(__name__)
def i():
return ""
app.add_url_rule("/", view_func=i, endpoint="index.html")
app.run()
Fix
from flask import Flask
app = Flask(__name__)
def i():
return ""
app.add_url_rule("/", view_func=i, endpoint="index") #<-- endpoint must not have a dot '.' character
app.run()
Add a possible fix
Please authorize to post fix