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

invalid template #5463

Closed
kakulukia opened this issue Sep 29, 2017 · 6 comments
Closed

invalid template #5463

kakulukia opened this issue Sep 29, 2017 · 6 comments

Comments

@kakulukia
Copy link

kakulukia commented Sep 29, 2017

im getting this error compressing my files:

Invalid template ..../site-packages/rest_framework/templates/rest_framework/filters/django_filter_crispyforms.html: 'crispy_forms_tags' is not a registered tag library. Must be one of:

Is django-crispy-forms a required lib? Why ist it not installed as dependency?
Python3.6 / DRF 3.6.4

@tomchristie
Copy link
Member

It's optional. Install it if you want to use the crispy forms filter.

@kakulukia
Copy link
Author

@tomchristie in not using crispy forms but still get the error :(
Its visible when i compress my source files with the following command:

manage.py compress -e pug,html --force

Its somehow picking up this template tho im not using it.

@tomchristie
Copy link
Member

Reopening for further consideration.
Anyone able to confirm that they can replicate this issue?

@tomchristie tomchristie reopened this Sep 29, 2017
@carltongibson
Copy link
Collaborator

@kakulukia compress that's django-compressor right?

Compressor searches all templates looking for {% compress %} blocks. So even though you're not using crispy forms, it's still going to look at those templates.

Short of putting together a template finder that skips these files I don't see a way round this... — it's just a coming together of a group of third-party libraries.

Maybe it's worth opening an ticket on Django Compressor, saying "skip this kind of error during compress".

I'm not sure that's worth the extra complexity there because...

Your simplest solution is to install crispy forms (and add it to INSTALLED_APPS) so that the compress command can find the tag library, and then move on.

This isn't a DRF issue. (As per above, at best, it's a compressor issue.)

I feel strangely at home on this ticket...

@kakulukia
Copy link
Author

i filed an issue at django-compressor, they really might be able to search differently for their compress tags

thx

@rpkilby
Copy link
Member

rpkilby commented Sep 29, 2017

As a side note, the django-filter templates should have been removed back in v3.5 but were accidentally left in. #5465 should fix this for the upcoming v3.7 release.

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

No branches or pull requests

4 participants