Django
- 3 ответа
- 0 вопросов
1
Вклад в тег
from django.shortcuts import render, get_object_or_404
def someview(request, slug=None):
some_obj =
return render(
request,
'someapp/someobject_detail.html',
{
'object': get_object_or_404(SomeObject, slug=slug),
'funky_page': True, # <--
}
)
<link href='{{ STATIC_URL }}css/style.css' rel='stylesheet' type='text/css'>
...
<li{% if funky_page %} class="funky"{% endif %}"></li>
...
li.funky { background-color: red; }