Shoile
Back to Projects

GeoAuth Plugin Project

DRF GeoData API

Django
Django REST Framework
Geo-Location
IP2Location
GeoAuth Plugin Project

Project Overview

A powerful Django REST API that provides real-time visitor and location intelligence using the IP2Location LITE database. It retrieves IP addresses, extracts detailed device information (browser, OS, device type), and fetches geo-location data including country, city, latitude, and longitude. It also offers country-level insights such as official languages, time zones, and currency — ideal for personalization and analytics use cases. 👉 Try the live API endpoint here: https://drf-geodata.onrender.com/ip/

Challenges
Key technical challenges addressed in this project
  • Integrating IP2Location database for accurate geo-location data
  • Extracting detailed device information from HTTP requests
  • Providing comprehensive country-level insights
  • Ensuring fast response times for real-time applications
Solutions
How these challenges were overcome
  • Implemented efficient database lookups for IP2Location data
  • Created custom middleware to extract and parse user agent information
  • Built a country information service with caching for performance
  • Optimized API responses with serialization and pagination

Technology Stack

Python

Primary programming language

Proficiency90%

Django

Web framework for rapid development

Proficiency85%

Django REST Framework

API toolkit for Django

Proficiency80%

IP2Location

Geo-location database

Proficiency75%

Redis

In-memory data store for caching

Proficiency70%

User-Agents

User agent parsing library

Proficiency65%

Project Metrics

12

API Endpoints

Total number of API endpoints

150ms

Response Time

Average response time

98%

Accuracy

Geo-location accuracy

85%

Cache Hit Rate

Redis cache efficiency

Development Timeline

Project Inception
February 2024

Initial planning and requirements gathering

IP2Location Integration
March 2024

Implementing geo-location database

Device Detection
April 2024

Adding user agent parsing

Caching Layer
April 2024

Implementing Redis caching

API Optimization
May 2024

Performance tuning and documentation

System Architecture

IP Detection Service

Extracts and validates visitor IP addresses

Device Information Service

Parses user agent for browser, OS, and device details

Geo-Location Service

Provides location data based on IP address

Country Information Service

Offers additional country-level insights

System Architecture Diagram

System Architecture Diagram: Visual representation of the project's components and data flow

Performance Metrics

API Response Time
< 150ms average
Accuracy
98% for country-level data
Scalability
Handles 1000+ requests per minute
Caching
Implemented Redis caching for frequent lookups