Code Monkey home page Code Monkey logo

Comments (4)

un33k avatar un33k commented on May 30, 2024 2

@luanfonceca you should use the latest api. get_real_ip and get_ip are deprecated.

Also, if you can move the QA to StackOverflow.

from django-ipware.

wking avatar wking commented on May 30, 2024 1

You can fake an IP by setting one of the headers in your requests (e.g. with curl -H 'X-Forwarded-For: 4.4.4.4' …). Alternatively, you can provide a knob to set IPWARE_PRIVATE_IP_PREFIX to an empty tuple if you're fine with your local IP.

from django-ipware.

wking avatar wking commented on May 30, 2024 1

from django-ipware.

luanfonceca avatar luanfonceca commented on May 30, 2024

Hi @wking, thanks for the response.

I tried to setup the IP_WARE_PRIVATE_IP_PREFIX for testing it out.

>>> from django.conf import settings
>>> print(settings.IPWARE_PRIVATE_IP_PREFIX)
()
>>> print(request._request.META.get('REMOTE_ADDR'))
'127.0.0.1'
>>> print(get_real_ip(request))
None

Sorry if i did something wrong, but still doesn't work.

from django-ipware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.