Skip to main content

Django Mobileesp

Basic usage

settings.py

MIDDLEWARE_CLASSES = (
    ...
    'django_mobileesp.middleware.UserAgentDetectionMiddleware'
)

from django_mobileesp.detector import mobileesp_agent as agent

DETECT_USER_AGENTS = {
    'is_android': agent.detectAndroid,
    'is_ios': agent.detectIos,
    'is_windows_phone': agent.detectWindowsPhone,
    'is_mobile': agent.detectTierTablet | \
                      agent.detectTierIphone | \
                      agent.detectMobileQuick,
}

If you prefer more pythonic methods, you can user a wrapper agent as follows:

from django_mobileesp.detector import python_agent as agent

DETECT_USER_AGENTS = {
    'is_android': agent.detect_android,
    'is_ios': agent.detect_ios,
    'is_windows_phone': agent.detect_windows_phone,
    'is_mobile': agent.detect_tier_tablet | \
                      agent.detect_tier_iphone | \
                      agent.detect_mobile_quick,
}

Finally access the defined attributes in your views:

def view(request):
    if request.is_mobile:
        ...

Metadata

Release files for django-mobileesp 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-mobileesp 1.0.1
File Size Uploaded Provenance Actions
Django-Mobileesp-1.0.1.tar.gz 10.5 kB Without provenance Details for Django-Mobileesp-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-mobileesp 1.0.1
File Interpreter ABI Platform Actions
Django_Mobileesp-1.0.1-py2-none-any.whl Python 2 none any Details for Django_Mobileesp-1.0.1-py2-none-any.whl

Total release size: 22.8 kB

Release files / Django-Mobileesp-1.0.1.tar.gz

Download URL Django-Mobileesp-1.0.1.tar.gz
Size 10.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ec7b5d1332a8b73942c8be946bb75c1a857810dcef0a3f9e366d499c0df55ea4
BLAKE2b-256 checksum
How to use checksums
ed9681bcea5ef735687e43a11ba8e5bcaa430ad2c8f86b46cab4fbd3d747ca27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / Django_Mobileesp-1.0.1-py2-none-any.whl

Download URL Django_Mobileesp-1.0.1-py2-none-any.whl
Size 12.2 kB
Tags Python 2
SHA-256 checksum
How to use checksums
6c93667a30c5f81f8a2cae97083498ab50d342392c061aa445a2d7fedd4f5a4f
BLAKE2b-256 checksum
How to use checksums
e9a9d05dd31d31a8705b741fd37adf9fce7444d1d9eeb1ebf79e12e1ef611c44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-mobileesp 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page