Romjan Ali
HomeAboutProjectsBlogContact

Developed by Romjan Ali

Copyright © 2025. All Rights Reserved

Romjan Ali
HomeAboutProjectsBlogContact
Back to Projects
Django Package

Django Clickify

A reusable Django app for tracking link clicks.

A simple Django app to track clicks on any link (e.g., affiliate links, outbound links, file downloads) with rate limiting, IP filtering, and geolocation.

Live DemoView Code
Duration

2 Week

Team

Solo Project

Django Clickify

Technologies Used

Django REST Framework
Django
django-ratelimit
pytest
Ruff

Project Screenshots

Django Admin view of tracked clicks.
Django Admin view of tracked clicks.
A screenshot of the Django Admin interface showing tracked clicks in a clear, sortable list format.
Detailed view of a click with geolocation data.
Detailed view of a click with geolocation data.
An in-depth view of a specific click, highlighting detailed information like geolocation data (country, city) and user agent.
Example of a successful API response.
Example of a successful API response.
An example of a successful API response in JSON format, demonstrating the structure of data returned by the service.

Case Study

Project Objective

The objective of this project was to create a reusable Django application to track clicks on any link such as Affiliate Link, File Downloads, Social Link. The application should be easy to integrate into existing Django projects and provide useful features like rate limiting, IP filtering, and geolocation.

Key Goals:

  • Log every click on a tracked link with IP address, user agent, and timestamp.
  • Enrich click logs with geolocation data.
  • Prevent abuse with rate limiting.
  • Allow IP filtering through allowlists and blocklists.
  • Provide both a Django template tag and a DRF API view for flexible integration.
Challenges & Solutions

Supporting both Traditional Django and Headless Setups

Implemented two separate integration methods: a template tag (`track_url`) for traditional Django templates and a DRF API view (`TrackClickAPIView`) for JavaScript-based frontends.

Making Features Optional

Used Django's `INSTALLED_APPS` and optional dependencies in `pyproject.toml` (`extras`) to allow users to install and enable only the features they need, such as DRF and rate limiting support.

Handling Rate Limiting Gracefully

For template-based views, the Django messages framework is used to display an error to the user. For the DRF API, a custom exception (`RateLimited`) is raised and handled by a DRF exception handler to return a `429 Too Many Requests` response.

Tools & Technologies

Frontend

  • N/A

Backend

  • Django
  • Django REST Framework
  • django-ratelimit

Deployment

  • PyPI

Tools

  • Git
  • GitHub
  • Pytest
  • Ruff
  • pre-commit
Key Features
Click Tracking
Geolocation
Rate Limiting
IP Filtering
Django Admin Integration
Flexible Usage (Template Tag and DRF API)
Results & Impact
1233
PyPI Downloads
Total number of downloads from the Python Package Index.
82%
Code Coverage
The percentage of code that is covered by automated tests.
1
GitHub Stars
The number of stars the project has on GitHub.
0
Open Issues
The number of open issues in the GitHub repository.

Key Achievements:

  • Successfully published to PyPI.
  • A fully functional and reusable Django app.
  • Comprehensive test suite with pytest.
  • Clean and maintainable code with the help of Ruff and pre-commit hooks.

Developed by Romjan Ali

Copyright © 2025. All Rights Reserved