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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
('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
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
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
19 matches
Mail list logo