не понимаю почему не проходит аргумент data
vievs.py
from django.shortcuts import render
from .models import Articles
from .forms import ArticlesForm
def create(request):
form = ArticlesForm()
data = {
'form': form
}
def index(request):
search = Articles.objects.order_by('manufacturer')
return render(request, 'main/index.html', {'search': search}, data)
def base(request):
return render(request, 'main/base.html')
Дэбаг меню выдает вот это:
Traceback (most recent call last):
File "C:\Users\Администратор\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\handlers\exception.py", line 47, in inner
response = get_response(request)
File "C:\Users\Администратор\AppData\Local\Programs\Python\Python310\lib\site-packages\django\core\handlers\base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Администратор\Desktop\articles\articles\main\views.py", line 14, in index
return render(request, 'main/index.html', {'search': search}, data)
Exception Type: NameError at /
Exception Value: name 'data' is not defined