Advertisement
houmie

Middleware

Aug 29th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. from django.utils import timezone
  2.  
  3. class TimezoneMiddleware(object):
  4. def process_request(self, request):
  5. tz = request.session.get('django_timezone')
  6. if tz:
  7. timezone.activate(tz)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement