fixed crash on missing templates dir when starting server
This commit is contained in:
parent
404e951651
commit
933210c93b
1 changed files with 7 additions and 5 deletions
|
@ -237,11 +237,13 @@ def serve(
|
||||||
observer.schedule(
|
observer.schedule(
|
||||||
event_handler, path=str(root / "content"), recursive=True
|
event_handler, path=str(root / "content"), recursive=True
|
||||||
)
|
)
|
||||||
observer.schedule(
|
templates = root / "templates"
|
||||||
event_handler,
|
if templates.is_dir():
|
||||||
path=str(root / "templates"),
|
observer.schedule(
|
||||||
recursive=True,
|
event_handler,
|
||||||
)
|
path=str(templates),
|
||||||
|
recursive=True,
|
||||||
|
)
|
||||||
observer.start()
|
observer.start()
|
||||||
|
|
||||||
# function to shut down gracefully
|
# function to shut down gracefully
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue