openedx.core.djangoapps.geoinfo package#
Submodules#
openedx.core.djangoapps.geoinfo.api module#
Simple Python API to identify the country of origin of page requests.
openedx.core.djangoapps.geoinfo.middleware module#
Middleware to identify the country of origin of page requests.
Middleware adds country_code in session.
Usage:
# To enable the Geoinfo feature on a per-view basis, use: decorator django.utils.decorators.decorator_from_middleware(middleware_class)
- class openedx.core.djangoapps.geoinfo.middleware.CountryMiddleware(get_response)#
Bases:
MiddlewareMixinIdentify the country by IP address.
- process_request(request)#
Identify the country by IP address.
Store country code in session.