Django - Недопустимое имя шаблона в теге 'extends': ''. Получил это из переменной 'current_module.base_template'
В своем проекте я хотел применить django-material frontend в соответствии с этим руководством http://docs.viewflow.io/frontend_crud.html. Я просто хотел добавить еще одно приложение к существующему и работающему проекту. К сожалению, я столкнулся с проблемой конфигурации urls.py. Вот некоторые фрагменты кода, которые могут быть полезны
INSTALLED_APPS
...
INSTALLED_APPS = [
'epm.apps.EpmConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_extensions',
'organize',
'crispy_forms',
'compressor',
'bootstrap_modal_forms',
'django_filters',
'fontawesome-free',
'material',
'material.frontend',
'viewflow',
'viewflow.frontend',
'ordercard',
'general.apps.GeneralConfig'
]
...
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
#'DIRS': [],
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'APP_DIRS': True,
...
...
...
Мой глобальный urls.py
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from material.frontend import urls as frontend_urls
from pprint import pprint
#from . import views
urlpatterns = [
path('', include('epm.urls')),
path('card/', include('ordercard.urls')),
path('admin/', admin.site.urls),
path('auth/', include('django.contrib.auth.urls')),
path('viewflow/', include(frontend_urls)),
path('organize/', include('organize.urls')),
url(r'general/', include('general.urls')),
path('', include(frontend_urls)),
]
и мой urls.py из общего приложения
from django.conf.urls import url, include
from django.views import generic
from material.frontend import urls as frontend_urls
from . import views
app_name='general'
urlpatterns = [
url('^$', generic.RedirectView.as_view(url='./customer/'), name="index"),
url('^customer/', include(views.MyModelViewSet().urls)),
#url(r'', include(frontend_urls)),
#url('', generic.TemplateView.as_view(template_name="sales/index.html"), name="index"),
]
При такой конфигурации файлов он получает сообщение об ошибке:
TemplateSyntaxError at /general/customer/
Invalid template name in 'extends' tag: ''. Got this from the 'current_module.base_template' variable.
Request Method: GET
Request URL: http://192.168.1.249:8080/general/customer/
Django Version: 3.1.7
Exception Type: TemplateSyntaxError
Exception Value:
Invalid template name in 'extends' tag: ''. Got this from the 'current_module.base_template' variable.
Exception Location: /usr/local/lib/python3.8/dist-packages/django/template/loader_tags.py, line 117, in get_parent
Python Executable: /usr/bin/python3
Python Version: 3.8.10
Python Path:
['/home/gaza/irel-test-workflow',
'/usr/lib/python38.zip',
'/usr/lib/python3.8',
'/usr/lib/python3.8/lib-dynload',
'/home/gaza/.local/lib/python3.8/site-packages',
'/usr/local/lib/python3.8/dist-packages',
'/usr/lib/python3/dist-packages',
'/home/gaza/.local/lib/python3.8/site-packages/IPython/extensions']
Server time: Thu, 18 Nov 2021 16:58:08 +0100
...
...
...
Error during template rendering
In template /usr/local/lib/python3.8/dist-packages/material/frontend/templates/material/frontend/views/list.html, error at line 1
Invalid template name in 'extends' tag: ''. Got this from the 'current_module.base_template' variable.
1 {% extends current_module.base_template %}
2 {% load i18n material_form material_form_internal material_frontend %}
3
4 {% block breadcrumbs_items %}
5 <a class="active" href="{% url view.model|frontend_urlname:'list' %}">{{ view.model|verbose_name_plural|title }}</a>
6 {% endblock %}
7
8
9 {% block content %}
10 {% block left-panel %}
11 <div class="left-panel">
Как правильно настроить urls.py?