Commit de882df4 authored by Michal Čihař's avatar Michal Čihař

Include date in context

parent ce1fe711
......@@ -146,6 +146,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.messages.context_processors.messages',
'trans.context_processors.version',
'trans.context_processors.title',
'trans.context_processors.date',
)
# A sample logging configuration. The only tangible logging
......
import trans
from django.conf import settings
from datetime import datetime, date
def version(request):
return {'version': trans.VERSION}
def title(request):
return {'site_title': settings.SITE_TITLE}
def date(request):
return {
'current_date': datetime.utcnow().strftime('%Y-%m-%d'),
'current_year': datetime.utcnow().strftime('%Y'),
'current_month': datetime.utcnow().strftime('%m'),
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment