Skip to content

Commit

Permalink
Updated staticfiles documentation with PathLike param
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinastone committed Aug 5, 2020
1 parent 8f5da0a commit dad99c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/staticfiles.md
Expand Up @@ -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`.
Expand Down Expand Up @@ -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

0 comments on commit dad99c8

Please sign in to comment.