Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add middleware for easy usage #36

Closed
wolph opened this issue Apr 4, 2018 · 3 comments
Closed

Add middleware for easy usage #36

wolph opened this issue Apr 4, 2018 · 3 comments

Comments

@wolph
Copy link

wolph commented Apr 4, 2018

I'm aware that writing the middleware manually is just a few lines of code but it would be very useful to have a simple middleware available

Within views it's easy enough to simply import the methods but Django still needs patching to have INTERNAL_IPS work correctly

@un33k
Copy link
Owner

un33k commented Apr 11, 2018

@wolph ipware is to return the IP address. Each project knows what needs to be done with the IP. Best practice is to call ipware on the first request and cache it for subsequent use. Then use the IP as it fits the project requirements.

@un33k un33k closed this as completed Apr 11, 2018
@wolph
Copy link
Author

wolph commented Apr 11, 2018

I don't get what you're trying to say...

I'm saying it would be useful to have a middleware integrated into the project. Something similar to this one: https://github.com/allo-/django-xforwardedfor-middleware/blob/master/x_forwarded_for/middleware.py

As for caching, that would be a useful thing to integrate into that middleware :)

@un33k
Copy link
Owner

un33k commented Apr 11, 2018

@wolph I see ... just a simple thing to make IP available downstream ... cool.

oldcai added a commit to oldcai/django-ipware that referenced this issue Apr 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants