hawat.blueprints.geoip package

Description

This pluggable module provides access to internal IP geolocation service. It is built upon custom mentat.services.geoip module, which in turn uses the geolocation service GeoLite2 created by MaxMind.

Provided endpoints

/geoip/search

Page providing search form and displaying search results.

  • Authentication: login required

  • Methods: GET

hawat.blueprints.geoip.BLUEPRINT_NAME = 'geoip'

Name of the blueprint as module global constant.

class hawat.blueprints.geoip.GeoipBlueprint(name, import_name, **kwargs)[source]

Bases: hawat.base.HawatBlueprint

Hawat pluggable module - IP geolocation service.

classmethod get_module_title()[source]

Implementation of hawat.base.HawatBlueprint.get_module_title().

register_app(app)[source]

Callback method. Will be called from hawat.base.HawatApp.register_blueprint() method and can be used to customize the Flask application object. Possible use cases:

  • application menu customization

Parameters

app (hawat.base.HawatApp) – Flask application to be customize.

class hawat.blueprints.geoip.SearchView[source]

Bases: hawat.base.HTMLMixin, hawat.base.RenderableView

Application view providing search form for internal IP geolocation service and appropriate result page.

The geolocation is implemented using mentat.services.geoip module.

authentication = True
authorization = [<Permission needs={Need(method='role', value='user'), Need(method='role', value='developer'), Need(method='role', value='admin'), Need(method='role', value='maintainer')} excludes=set()>]
dispatch_request()[source]

Mandatory interface required by the flask.views.View.dispatch_request(). Will be called by the Flask framework to service the request.

classmethod get_menu_title(item=None)[source]

Implementation of hawat.base.BaseView.get_menu_title().

classmethod get_view_name()[source]

Implementation of hawat.base.BaseView.get_view_name().

classmethod get_view_title(item=None)[source]

Implementation of hawat.base.BaseView.get_view_title().

methods = ['GET']
hawat.blueprints.geoip.get_blueprint()[source]

Mandatory interface and factory function. This function must return a valid instance of hawat.base.HawatBlueprint or flask.Blueprint.