load tag in Django 3.0 - Devinwon/article GitHub Wiki
In the old version,we had to use {% load staticfiles %}
to load static files(like js/css/images),but in Djnago 3.0+,use {% load static %}
instead.
You can also add more configuration in your project setting file to avoid load tag in templates.Just like below.
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR,'apps/login/templates')],
'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',
],
'builtins':
['django.templatetags.static'] #new added,no {% load static %} in html
},
},
]
python manage.py collectstatic
django使用mysql数据库链接的库
pip install mysqlclient