DT
Size: a a a
DT
ДА
request.POST.get()
, приходит 2 ?АВ
DT
АВ
АВ
DT
m
АВ
class PageView(generic.base.TemplateView):
def get_obj(self):
try:
path = self.request.path
obj = models.Pages.published.get(slug=path)
return obj
except Exception as e:
raise
def get_template_names(self):
template_name = self.get_obj().template_name
return template_name
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
obj = self.get_obj()
context['page'] = obj
context['services'] = obj.services_set.all()
context['groupstickers'] = obj.groupstickers_set.all()
import pdb; pdb.set_trace()
return context
except Exception as e:
return context
tn
class PageView(generic.base.TemplateView):
def get_obj(self):
try:
path = self.request.path
obj = models.Pages.published.get(slug=path)
return obj
except Exception as e:
raise
def get_template_names(self):
template_name = self.get_obj().template_name
return template_name
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
try:
obj = self.get_obj()
context['page'] = obj
context['services'] = obj.services_set.all()
context['groupstickers'] = obj.groupstickers_set.all()
import pdb; pdb.set_trace()
return context
except Exception as e:
return context
DT
m
АВ
tn
DT
АВ
path('<slug:slug>/', views.PageView.as_view(), name='page')
но выдаёт ошибкуDoesNotExist at /buh/
Pages matching query does not exist.
m
tn
DT
path('<slug:slug>/', views.PageView.as_view(), name='page')
но выдаёт ошибкуDoesNotExist at /buh/
Pages matching query does not exist.
DT