Is there something as simple as plug in the code and go for geolocation? I only want countries so that my website can switch to the appropriate language.
It seems that the ones I found are either deprecated, have less than 10 users, are paid/trial versions.
Faced this problem recently - indeed there are only paid options out there. However, there is an almost free solution is to use Google Cloud functions for that.
https://cloud.google.com/functions/docs/create-deploy-gcloud
Here is the code of a function you want to implement:
Then in the JS code of your web-page you call this function and get country from
data.country.However, if what you want is the language selection - I recommend using auto-selection of the language included in Django. Add to your middlewares:
It will autodetect user's language based on browser settings. More info: https://docs.djangoproject.com/en/4.1/topics/i18n/translation