New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StaticFiles directory argument should take a PathLike instead of a str #1004
Comments
Sure thing, yup! |
kevinastone
added a commit
to kevinastone/starlette
that referenced
this issue
Jul 20, 2020
This allows using `pathlib.Path` in addition to `str` for configuring the base directory of the static files in line with how python3.6+ handles filesystem operations. Fixes encode#1004
kevinastone
added a commit
to kevinastone/starlette
that referenced
this issue
Jul 27, 2020
This allows using `pathlib.Path` in addition to `str` for configuring the base directory of the static files in line with how python3.6+ handles filesystem operations. Fixes encode#1004
kevinastone
added a commit
to kevinastone/starlette
that referenced
this issue
Aug 5, 2020
This allows using `pathlib.Path` in addition to `str` for configuring the base directory of the static files in line with how python3.6+ handles filesystem operations. Fixes encode#1004
erewok
pushed a commit
that referenced
this issue
Aug 5, 2020
* Use os.PathLike in StaticFiles for directory This allows using `pathlib.Path` in addition to `str` for configuring the base directory of the static files in line with how python3.6+ handles filesystem operations. Fixes #1004 * Fixed `mimetypes.guess_type` not supporting PathLike on py3.7 and below * Updated staticfiles documentation with `PathLike` param
Hi, I know this is closed, but can the same be done for 'Jinja2Templates'? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be preferable to allow the
StaticFiles
app to use anos.PathLike
so you can also providepathlib.Path
instances. I can work on a PR if there's agreement.The text was updated successfully, but these errors were encountered: