-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[DO NOT MERGE] -- location-based ip blocking #2509
Conversation
will do. |
looking now. first you should add "pygeoip==0.3.0" |
License for pygeoip is License: LGPLv3+ |
""" | ||
simple middlware to block IP addresses | ||
""" | ||
gi = pygeoip.GeoIP(settings.GEOIP_DAT_LOCATION, pygeoip.MEMORY_CACHE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would making this a part of the module, instead of part of the class, be more efficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, I think this is okay. it's in the class prototype.
Just my2cents, but why not just do the blocking with nginx or apache? It seems simpler and more configurable than adding it inside the platform. http://nginxlibrary.com/ip-based-country-blocking/ for nginx example. |
that approach has merits for sure--do we need to compile our own nginx to do that? |
nginx -V on my vanilla sandbox install it has the geo_ip module baked in. |
Nice! On Feb 7, 2014, at 9:29 AM, Carson Gee notifications@github.com wrote:
|
@ali123 it also looks like you need to do a similar envs setup for cms |
can you also move the middleware into its own file? some import sequences used by the "gather-assets" step of prod install load |
This pull request hasn't been touched in a month, it needs a rebase, and the title is marked "DO NOT MERGE". Can this pull request be closed, or is it still being used for something? |
@singingwolfboy I'm closing this PR. We've implemented it at nginx level. |
* feat: XBlock's children API as DRF * fix: 500 error appears if user adds a Content Experiment * fix: wrap into try/except block getting icon for xblock (#2509) * fix: wrap into try/except block getting icon for xblock * fix: revision after review
@jbau please take a look