[feature] Base setup for WHOIS model #1032 #1033 #1037 #1045
Checklist
- [x] I have read the OpenWISP Contributing Guidelines.
- [x] I have manually tested the changes proposed in this pull request.
- [x] I have written new test cases for new code and/or updated existing tests for changes to existing code.
- [x] I have updated the documentation.
Reference to Existing Issue
Closes #1032 Closes #1033 Closes #1037 Closes #1045
Description of Changes
Added a new model to store WHOIS details for a device with the required fields.
Implemented a new celery task to fetch WHOIS details using the geoip2 web service.
Using an external library instead of the wrapper class provided by django because the wrapper class is designed to work with local databases and also is not currently designed to work with ASN databases.
In order to trigger the task whenever last_ip changes, using existing logic of _changed_fields to track the changes.
Steps to obtain GeoIP creds
-
Create Maxmind account using the following link: https://www.maxmind.com/en/geolite2/signup?utm_source=kb&utm_medium=kb-link&utm_campaign=kb-create-account
-
Go to
Manage License Keys -
Generate a New license Key. Name it whatever you like
-
Copy the Account Id and License Key and Paste it in the environment variables:
GEOIP_ACCOUNT_IDandGEOIP_LICENSE_KEY.