Commit cbc72c5e authored by pgjones's avatar pgjones
Browse files

Bugfix setting the debug property on the app

It should, as it does in Flask, also set the jinja_env auto_reload
parent 2629e4ff
Pipeline #228860151 passed with stages
in 3 minutes and 11 seconds
......@@ -148,7 +148,6 @@ class Quart(PackageStatic):
asgi_lifespan_class = ASGILifespan
asgi_websocket_class = ASGIWebsocketConnection
config_class = Config
debug = ConfigAttribute("DEBUG")
env = ConfigAttribute("ENV")
jinja_environment = Environment
jinja_options = {
......@@ -343,6 +342,19 @@ class Quart(PackageStatic):
"""Return if the app has received a request."""
return self._got_first_request
def debug(self) -> bool:
"""Activate debug mode (extra checks, logging and reloading).
Should/must be False in production.
return self.config["DEBUG"]
def debug(self, value: bool) -> None:
self.config["DEBUG"] = value
self.jinja_env.auto_reload = self.templates_auto_reload
def templates_auto_reload(self) -> bool:
"""Returns True if templates should auto reload."""
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment