If you have any of the following tags in your template:
{% load staticfiles %}
{% load static from staticfiles %}
{% load admin_static %}
Then replace it with:
{% load static %}
You have to make this change because {% load staticfiles %}
and {% load admin_static %}
were deprecated in Django 2.1, and removed in Django 3.0.
{% load static %}
instead of {% load staticfiles %}
settings.py
fileSTATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
VENV_PATH = os.path.dirname(BASE_DIR)
STATIC_ROOT = os.path.join(VENV_PATH, 'static_root')
staticfiles has been change to static
You can register with the fallowing code in your setting.py
Add this code in your TEMPALTE settings
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
'libraries' : {
'staticfiles': 'django.templatetags.static',
}
},
},
]
Note the you can find libraries witch you don't have it
This worked for me using django 3.1.4.
{% load static %}
<link rel"stylesheet" href = "{% static 'style.css' %}">
this worked with me replace {% load static from staticfiles %}
with {% load static %}
where :
go to your virtual environment "venv" /lip/python3.X/site-packages/leaflet/templates/leaflet/admin/widget.html and all of the .HTML files in the directory
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With