Closed freezed closed 4 years ago
@freezed:
Admin theme is theme which looks like Django admin. Other themes don't need that.
You could make simple checks in templates.
https://github.com/barseghyanartur/django-nine#in-templates
{% if VERSIONS.DJANGO_GTE_2_1 %}
{% load static %}
{% else %}
{% load admin_static %}
{% endif %}
I try conditional loading in template, but on one hand my test still fail :
settings.py
: https://gist.github.com/freezed/d5b18e8218c23fc64e4e8dc467e4b2a4theme/simple
: https://github.com/freezed/django-fobi/commit/3ebfa83a30a47ce593d8c123fc248fff71b093e0?diff=split.venv/lib/python3.6/site-packages/django/contrib/admin/templatetags/admin_static.py:14: RemovedInDjango30Warning: {% load admin_static %} is deprecated in favor of {% load static %}
On the other hand, with the same basecode / settings, the use of nine
in a basic template using a browser on ./manage.py runserver
works :
template.html
: <p>DJANGO_GTE_2_1: {{ VERSIONS.DJANGO_GTE_2_1|yesno:"yeah,no,maybe" }}</p>
DJANGO_GTE_2_1: yeah
Is there something I miss between runserver
& pytest
?
@freezed:
Did you push to your branch? I could take a look.
We are trying to update to django 3.0 and are getting errors from the templates for the deprecated import.
I made a comment over on the merged PR for this issue, but I wanted to post one here also since the issue is still open.
https://github.com/barseghyanartur/django-fobi/pull/214#issuecomment-608072628
Thanks for bringing this up. I'll do the manual merge shortly (to be released in a couple of days).
@0pt1c:
Done in 0.16.2.
My tests warns me about
{% load admin_static %}
deprecation.This tag is used in
simple
&DjangoCMS
themes : https://github.com/barseghyanartur/django-fobi/search?q=admin_static&type=CodeWas it removed from other themes, or it just had be only used here?
I replaced
admin_static
bystatic
in my code :Without more tests or checks, and it looks like doing the job.
Can I just commit this change or it needs some other checks ?
(I run this in
Django
2.1.7 & 2.2)