1👍
✅
Try this:
from calendar import HTMLCalendar
from django.shortcuts import render
def foo(request):
cal = HTMLCalendar()
calendar = cal.formatmonth(2013, 6)
return render(request, 'foo.html', { 'calendar': calendar})
or you could even do dict(calendar=calendar)
and in template
{{calendar|safe}}
Source:stackexchange.com