--- id: django-user-agents version: "0.4.0" license: MIT license_treatment: permissive maintenance: abandoned --- # django-user-agents — A django package that allows easy identification of visitors' browser, operating system and device information (mobile phone, tablet or has touch capabilities). License: permissive · Maintenance: abandoned · Downloads: 793.3K/mo ## What it is and what it does django-user-agents is a Django middleware and utility package that wraps user-agents to parse HTTP User-Agent headers and expose device, browser, and OS information on each request. It adds a user_agent attribute to the request object, allowing you to check properties like is_mobile, is_tablet, is_touch_capable, is_pc, and is_bot, plus access detailed browser family and version, OS family and version, and device family. The package also provides template filters and a utility function for use in views. The package depends on django and user-agents as runtime dependencies. It supports optional caching via Django's cache framework to avoid re-parsing the same User-Agent strings. However, the package has been abandoned since 2019—no releases or commits for several years—and its classifiers reflect Python 2.7 and Python 3.4–3.7, all now end-of-life. Using it on modern Python or Django versions carries risk of undetected incompatibilities. Use it for: - Serve different HTML or CSS to mobile visitors versus desktop users without JavaScript detection. - Log or track device type (phone, tablet, PC) for analytics or user behavior studies. - Conditionally render touch-friendly UI components in templates when is_touch_capable is true. - Block or flag bot traffic by checking is_bot in middleware or views. - Adapt API responses or content based on device capabilities detected from User-Agent. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses HTTP User-Agent headers in Django to identify visitor browser, OS, device type, and capabilities like mobile or touch support. No—not without caution. The package is abandoned (last release 2019-06-22, last commit 2021-09-02) and its classifiers only cover Python 2.7 and 3.4–3.7, all end-of-life. Compatibility with modern Django and Python is unverified. For new projects, consider a maintained alternative or verify that the upstream user-agents library is still actively updated before committing. ## Install pip install django-user-agents uv add django-user-agents poetry add django-user-agents ## Installing django-user-agents Before you install: Low friction install with just two runtime dependencies. However, the package is abandoned—last release was 2019-06-22 and last commit 2021-09-02. Classifiers list Python 2.7 and Python 3.4–3.7, which are now end-of-life; compatibility with modern versions is unverified. License in practice: MIT license (permissive) places no restrictions on use, modification, or distribution in your own projects. Quickstart: pip install django-user-agents # In settings.py INSTALLED_APPS = ['django_user_agents'] MIDDLEWARE_CLASSES = ['django_user_agents.middleware.UserAgentMiddleware'] # In views.py def my_view(request): if request.user_agent.is_mobile: # Handle mobile visitor Requires django and user-agents to be installed first. Optional but recommended: a cache backend configured in Django settings to speed up parsing. Verify before relying: - Compatibility with Django versions released after 2.2. - Compatibility with Python versions after 3.7. - Whether the underlying user-agents library is still maintained and receives UA database updates. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 793.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django user agent detection, browser os device identification, mobile tablet detection django, user agent parsing middleware, visitor device classification, device-detection, middleware, abandoned [View on SkillFed](https://skillfed.io/packages/django-user-agents) · [View on PyPI](https://pypi.org/project/django-user-agents/)