Re: REMOTE_ADDR

2010-03-16 Thread Bill Freeman
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

Re: REMOTE_ADDR

2010-03-16 Thread Ken Lacey
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

Re: REMOTE_ADDR

2010-03-15 Thread James Bennett
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

Re: REMOTE_ADDR

2010-03-15 Thread ge...@aquarianhouse.com
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

REMOTE_ADDR

2010-03-15 Thread Ken Lacey
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

Re: testing and request.META['REMOTE_ADDR']

2008-01-05 Thread Thomas
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

Re: testing and request.META['REMOTE_ADDR']

2008-01-04 Thread Malcolm Tredinnick
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

testing and request.META['REMOTE_ADDR']

2008-01-04 Thread Thomas
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