Django
- 1 ответ
- 0 вопросов
1
Вклад в тег
import pytz
from django.utils import timezone
from django.views.generic import TemplateView
class PageView(TemplateView):
template_name = 'page.html'
def get_context_data(self, **kwargs):
context = super(PageView, self).get_context_data(**kwargs)
context['dt'] = timezone.datetime(2000, 12, 31, 12, 0, 0, tzinfo=pytz.UTC)
return context
{% load tz %}
{% timezone "Europe/Paris" %}{{ dt }}{% endtimezone %}