barseghyanartur / django-fobi

Form generator/builder application for Django done right: customisable, modular, user- and developer- friendly.
https://pypi.python.org/pypi/django-fobi
484 stars 112 forks source link

{% load admin_static %} is deprecated in favor of {% load static %} #213

Closed freezed closed 4 years ago

freezed commented 5 years ago

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=Code

Was it removed from other themes, or it just had be only used here?

I replaced admin_static by static in my code :

fobi/contrib/themes/simple/templates/simple/base_edit.html
fobi/contrib/themes/simple/templates/simple/dashboard.html
fobi/contrib/themes/simple/templates/simple/edit_form_entry.html
fobi/contrib/themes/simple/templates/simple/edit_form_wizard_entry.html
fobi/contrib/themes/simple/templates/simple/form_wizards_dashboard.html
fobi/contrib/themes/simple/templates/simple/import_form_entry.html

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)

barseghyanartur commented 5 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 %}
freezed commented 5 years ago

I try conditional loading in template, but on one hand my test still fail :

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 :

Is there something I miss between runserver & pytest ?

barseghyanartur commented 5 years ago

@freezed:

Did you push to your branch? I could take a look.

0pt1c commented 4 years ago

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

barseghyanartur commented 4 years ago

Thanks for bringing this up. I'll do the manual merge shortly (to be released in a couple of days).

barseghyanartur commented 4 years ago

@0pt1c:

Done in 0.16.2.