On 3/8/07, fyl <[EMAIL PROTECTED]> wrote: > This is somewhere between an observation and a question. I am writing > a view that needs to know "some stuff", in particular > HTTP_ACCEPT_LANGUAGE. As I read the developing book and look at the on- > line documentation, it is not clear what is available and, probably > more important, what is good practice to use it.
I agree that it's something we need to work on, especially with views; unfortunately, a view can technically do absolutely anything that's legal to do in Python, so long as it accepts a 'request' argument and returns an HttpResponse, so it's a bit of a hurdle :) With respect to the Accept-Language header, the request/response docs[1] mention that it, and any other HTTP headers you want to look at, are available in request.META -- in this case, it's request.META['HTTP_ACCEPT_LANGUAGE']. [1] http://www.djangoproject.com/documentation/request_response/ -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct." --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---