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

Feature Request: setting to ignore templates within specific directories #40

Closed
geoffbeier opened this issue Jul 7, 2024 · 1 comment · Fixed by #41
Closed

Feature Request: setting to ignore templates within specific directories #40

geoffbeier opened this issue Jul 7, 2024 · 1 comment · Fixed by #41

Comments

@geoffbeier
Copy link
Contributor

I'm using django-allauth-ui and just enabled django-fastdev for the first time. It has been helpful and smooth for the most part. In order to avoid sending tailwind css twice in every allauth-ui template while still using my custom daisyui theme, I needed to copy the allauth-ui templates into my project.

django-allauth-ui uses slippers components internally. A common pattern for those components is:

{% var render_fields=render_fields|default:"true" %}

When I first saw the error, I tried writing a context processor that would set those variables that get caught in this check to None by default, as described in a reply on issue #30. Slippers doesn't pass context through to the components by default, though, so that's not a fix.

And fixing the "vendored" templates to explicitly pass a None every time this pattern appears is going to slow me down when it comes time to update to the next release of django-allauth-ui. Given their release cadence, I'd like very much to avoid merge headaches.

I think what I'd really like to do is ignore everything in the components directory of the templates tree I copied in from django-allauth-ui.

I believe a relatively easy way to do this would be adding a FASTDEV_IGNORED_TEMPLATES setting which defaults to an empty list and just returns orig_resolve(self,context) from resolve_override() if one of the expressions on that list matches the current template.

I'd be happy to put together a PR and submit it if this seems useful.

@boxed
Copy link
Owner

boxed commented Jul 8, 2024

Yea that would be great!

@boxed boxed closed this as completed in #41 Jul 8, 2024
@boxed boxed closed this as completed in 55fddb2 Jul 8, 2024
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