From dad99c846e17128179af217671a3756b292ca476 Mon Sep 17 00:00:00 2001 From: Kevin Stone Date: Wed, 5 Aug 2020 10:17:27 -0500 Subject: [PATCH] Updated staticfiles documentation with `PathLike` param --- docs/staticfiles.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/staticfiles.md b/docs/staticfiles.md index aabc67d90..d8786af4d 100644 --- a/docs/staticfiles.md +++ b/docs/staticfiles.md @@ -5,7 +5,7 @@ Starlette also includes a `StaticFiles` class for serving files in a given direc Signature: `StaticFiles(directory=None, packages=None, check_dir=True)` -* `directory` - A string denoting a directory path. +* `directory` - A string or [os.Pathlike][pathlike] denoting a directory path. * `packages` - A list of strings of python packages. * `html` - Run in HTML mode. Automatically loads `index.html` for directories if such file exist. * `check_dir` - Ensure that the directory exists upon instantiation. Defaults to `True`. @@ -51,3 +51,5 @@ app = Starlette(routes=routes) You may prefer to include static files directly inside the "static" directory rather than using Python packaging to include static files, but it can be useful for bundling up reusable components. + +[pathlike]: https://docs.python.org/3/library/os.html#os.PathLike