silentsokolov / django-admin-rangefilter

A Django app that lets you filter data by date range and numeric range in the admin UI
MIT License
713 stars 106 forks source link

Use of `admin_static` causes `validate_templates` fails #78

Closed amrishparmar closed 2 years ago

amrishparmar commented 2 years ago

When I attempt to run the ~built-in~ Django management command validate_templates, this library triggers the following error

/usr/local/lib/python3.10/site-packages/rangefilter/templates/rangefilter/date_filter_1_8.html: TemplateSyntaxError 'admin_static' is not a registered tag library.

Python version: 3.10.4 Django version: 4.0.4

Though I have only tested this on Django 4, this same error will likely be present in all versions of Django >= 3.0 as that's when the deprecated feature was removed

silentsokolov commented 2 years ago

validate_templates this is not official command.

We use different templates in our code for the different the django versions. date_filter_1_8.html - template for <= 1.8.

I think about how to resolve.

amrishparmar commented 2 years ago

validate_templates this is not official command.

Apologies, I should have noted that this command is from the https://github.com/django-extensions/django-extensions package

I think about how to resolve.

Thanks for taking a look.