ollowing in http.py in the middleware folder
>
> class SetRemoteAddrFromForwardedFor(object):
> """
> Middleware that sets REMOTE_ADDR based on HTTP_X_FORWARDED_FOR, if
> the
> latter is set. This is useful if you're sitting behind a reverse
> proxy that
> caus
Middleware that sets REMOTE_ADDR based on HTTP_X_FORWARDED_FOR, if
the
latter is set. This is useful if you're sitting behind a reverse
proxy that
causes each request's REMOTE_ADDR to be set to 127.0.0.1.
Note that this does NOT validate HTTP_X_FORWARDED_FOR. If you're
not behin
On Mon, Mar 15, 2010 at 8:45 AM, Ken Lacey <ken.la...@dit.ie> wrote:
> Using request.META['REMOTE_ADDR'] I get an error
>
> Exception Type: TemplateSyntaxError
> Exception Value: Could not parse the remainder: '['REMOTE_ADDR']' from
> 'request.METTA['REMOTE_ADDR']'
&g
it seem to me, it's in the template.
when it should work like this:
{{ request.META.REMOTE_ADDR }}
btw:
> 'request.METTA['REMOTE_ADDR']' <--- in META is one T to much
On Mar 15, 2:45 pm, Ken Lacey <ken.la...@dit.ie> wrote:
> Hi
>
> I am trying to access the remote addr
Hi
I am trying to access the remote addr in a view.
Using request.META['REMOTE_ADDR'] I get an error
Exception Type: TemplateSyntaxError
Exception Value: Could not parse the remainder: '['REMOTE_ADDR']' from
'request.METTA['REMOTE_ADDR']'
How do I get over this?
Thanks
Ken
--
You
Malcolm, thanks for the answer. I should have better read src of
client.py.
default for query environment can be overridden like so:
c = Client(REMOTE_ADDR ='127.0.0.1') - this solves my problem!
> Work out which standards are relevant. If REMOTE_ADDR *must* be supplied
> by all web s
On Fri, 2008-01-04 at 14:30 -0800, Thomas wrote:
> I am testing django.contrib.comments with django.test.client that does
> not provide request.META['REMOTE_ADDR'] and therefore dies at
> http://code.djangoproject.com/browser/django/trunk/django/contrib/comments/views/comment
I am testing django.contrib.comments with django.test.client that does
not provide request.META['REMOTE_ADDR'] and therefore dies at
http://code.djangoproject.com/browser/django/trunk/django/contrib/comments/views/comments.py#L252
There has been a ticked #407 but that did not change all
8 matches
Mail list logo