Skip to content
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

template_loader blocks on STATICFILES_DIRS if there are tuples #476

Closed
alexandreMartinEcl opened this issue May 3, 2024 · 1 comment · Fixed by #489
Closed

template_loader blocks on STATICFILES_DIRS if there are tuples #476

alexandreMartinEcl opened this issue May 3, 2024 · 1 comment · Fixed by #489

Comments

@alexandreMartinEcl
Copy link
Contributor

How to reproduce

Simply run django with, in your settings.py, something like :

STATICFILES_DIRS = [
    # ...
    ("downloads", "/opt/webfiles/stats"),
]

(as made possible natively in Django)

Current behaviour

Getting TypeError: expected str, bytes or os.PathLike object, not tuple given [this line] (

if not Path(component_dir).is_dir():
)

Expected

class Loader from src/django_components/template_loader.py should consider the second item of STATICFILES_DIRS list item when not a str.

Furthermore

Thank you a lot, sir, for this django library. It helped us, a French news company, a lot to center our codebase almost fully on Django.
I might try to suggest a clean PR for this

@EmilStenstrom
Copy link
Owner

@alexandreMartinEcl Happy to hear that your are getting more use from Django based off this library! Makes my developer heart beat a little faster <3

As for the suggestion, I think this is something we should fix. If you could write up a PR, with a corresponding test, we can add that to the library!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants