[pylons-discuss] pyramid_debugtoolbar without REMOTE_ADDR

2017-05-18 Thread JÁKÓ András
Hi, I'm trying to use pyramid_debugtoolbar with nginx and gunicorn, talking on a unix domain socket. This makes an empty REMOTE_ADDR, and I wonder how can I make pyramid_debugtoolbar work. I checked that request.remote_addr is empty, while request.client_addr contains my browser's IP address

Is request.environ['REMOTE_ADDR'] useless when Pyramid App is deployed via Apache/ProxyPass?

2011-03-03 Thread lost_rat
The variable: request.environ['REMOTE_ADDR'] always returns 127.0.0.1 for all requests when my Pyramid App is deployed via Apache using ProxyPass Snippet from httpd.conf: VirtualHost *:80 ServerName www.example.com ServerAlias example.com # - this is the line

Re: Is request.environ['REMOTE_ADDR'] useless when Pyramid App is deployed via Apache/ProxyPass?

2011-03-03 Thread Chris McDonough
You might try: environ.get('HTTP_X_FORWARDED_FOR', environ['REMOTE_ADDR']) See also http://thepcspy.com/read/getting_the_real_ip_of_your_users/ On Thu, 2011-03-03 at 07:43 -0800, lost_rat wrote: The variable: request.environ['REMOTE_ADDR'] always returns 127.0.0.1 for all requests when

Re: Is request.environ['REMOTE_ADDR'] useless when Pyramid App is deployed via Apache/ProxyPass?

2011-03-03 Thread Yannick Gingras
On March 3, 2011, Chris McDonough wrote: environ.get('HTTP_X_FORWARDED_FOR', environ['REMOTE_ADDR']) You can only trust X_FORWARDED_FOR if there is a proxy in front of your app. If the app is facing the Web without a proxy, you should read REMOTE_ADDR because X_FORWARDED_FOR is trivial to spoof

REMOTE_ADDR

2010-01-04 Thread Alagu Madhu
Hi I try to get client IP using request.environ.get(REMOTE_ADDR),it is working.But It is not working in website. Thanks Madhu Alagu -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to pylons-disc

Re: REMOTE_ADDR

2010-01-04 Thread Mike Orr
On Mon, Jan 4, 2010 at 1:10 AM, Alagu Madhu alma...@gmail.com wrote: Hi I try to get client IP using request.environ.get(REMOTE_ADDR),it is working.But It is not working in website. Try raising a RuntimeError in the controller, and in the interactive traceback execute sorted

Re: REMOTE_ADDR

2010-01-04 Thread Jose Galvez
the environment variable may be different if you are serving the site from apache. I think is X_REMOTE_ADDR or something like that Alagu Madhu wrote: Hi I try to get client IP using request.environ.get(REMOTE_ADDR),it is working.But It is not working in website. Thanks Madhu Alagu

Re: REMOTE_ADDR

2010-01-04 Thread Alagu Madhu
The website is running apache. request.environ[REMOTE_ADDR] - 127.0.0.1 request.environ[X_REMOTE_ADDR] - error thanks On Jan 5, 3:39 am, Jose Galvez jj.gal...@gmail.com wrote: the environment variable may be different if you are serving the site from apache.  I think is X_REMOTE_ADDR

Re: REMOTE_ADDR

2010-01-04 Thread Didip Kerabat
I use both HTTP_X_FORWARDED_FOR and REMOTE_ADDR, just in case. See below: * def get_ip_address(): return request.environ.get(HTTP_X_FORWARDED_FOR, request.environ.get(REMOTE_ADDR, None))* - Didip - On Mon, Jan 4, 2010 at 9:21 PM, Alagu Madhu alma...@gmail.com wrote: The website

Re: REMOTE_ADDR

2010-01-04 Thread Alagu Madhu
apache: request.environ.get(HTTP_X_FORWARDED_FOR) thanks On Jan 5, 8:33 am, Didip Kerabat did...@gmail.com wrote: I use both HTTP_X_FORWARDED_FOR and REMOTE_ADDR, just in case. See below: *  def get_ip_address():     return request.environ.get(HTTP_X_FORWARDED_FOR, request.environ.get

Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Bryan
Some of my controllers look in the request for 'REMOTE_ADDR' to get the client's ip address for logging. When I run my unit tests with nosetests, REMOTE_ADDR is not present in the request object, causing an error. I would like to insert a fake ip address into the request in my unit tests so

Re: Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Gustavo Narea
On Friday April 3, 2009 19:10:09 Bryan wrote: Some of my controllers look in the request for 'REMOTE_ADDR' to get the client's ip address for logging. When I run my unit tests with nosetests, REMOTE_ADDR is not present in the request object, causing an error. I would like to insert a fake

Re: Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Bryan
Thanks, that works. I think I am going to change my controller code to ip = request.environ.get('REMOTE_ADDR', 'No IP address?') instead. That will be less work that appending special arguments to all of my requests in testing. I was hoping there was a way to do it for all functional test get

Re: Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Gustavo Narea
to change my controller code to ip = request.environ.get('REMOTE_ADDR', 'No IP address?') instead. That will be less work that appending special arguments to all of my requests in testing. I was hoping there was a way to do it for all functional test get() calls. On Apr 3, 10:39 am, Gustavo

Re: Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Wyatt Baldwin
On Apr 3, 11:20 am, Bryan bryanv...@gmail.com wrote: Thanks, that works.  I think I am going to change my controller code to ip = request.environ.get('REMOTE_ADDR', 'No IP address?') instead. That will be less work that appending special arguments to all of my requests in testing.  I

Re: Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Wyatt Baldwin
On Apr 3, 12:42 pm, Wyatt Baldwin wyatt.lee.bald...@gmail.com wrote: On Apr 3, 11:20 am, Bryan bryanv...@gmail.com wrote: Thanks, that works.  I think I am going to change my controller code to ip = request.environ.get('REMOTE_ADDR', 'No IP address?') instead. That will be less work

Re: Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Wyatt Baldwin
('REMOTE_ADDR', 'No IP address?') instead. That will be less work that appending special arguments to all of my requests in testing.  I was hoping there was a way to do it for all functional test get() calls. Isn't there a setUp method where you can do this, since TestController

Re: Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Wyatt Baldwin
think I am going to change my controller code to ip = request.environ.get('REMOTE_ADDR', 'No IP address?') instead. That will be less work that appending special arguments to all of my requests in testing.  I was hoping there was a way to do it for all functional test get() calls

Re: Accessing REMOTE_ADDR during unit tests

2009-04-03 Thread Bryan
code to ip = request.environ.get('REMOTE_ADDR', 'No IP address?') instead. That will be less work that appending special arguments to all of my requests in testing.  I was hoping there was a way to do it for all functional test get() calls. Isn't there a setUp method where you