My RequestObject must contain information about user device (mobile,
tablets etc) with device capatibilites (resolution, video codecs
etc) .
It's a data collection not simple string. Then I want use it in views
and templates.
So, simply attach your information as an attribute of the standard request object. No need to replace it. You probably want to do this in a middleware.
class DeviceInfoMiddleware(object):
def process_request(self, request):
request.device_info = {'resolution': '800x600', 'codecs': ['H264', 'WebM']}
--
DR.
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment