Skip to main content

django-mobile-views is a simple app to help detect mobile browsers and serve a different template for them.

It works by inspecting the user agent.

To use, either use one of the mobile generic views, or add the MobileMixin to your class based view.

from mobile_views.generic_views import MobileTemplateView

class HomePage(MobileTemplateView):

template_name = ‘myapp/home_page.html’ mobile_template_name = ‘myapp/mobile_home_page.html’

And that’s it!

There is also a ‘FullSiteView’ provided that when accessed will set a cookie to prevent being served the mobile template. The cookie lasts until browser close.

Metadata

Release files for django-mobile-views 0.1.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-mobile-views 0.1.1
File Size Uploaded
django-mobile-views-0.1.1.tar.gz 5.0 kB Details

Release files / django-mobile-views-0.1.1.tar.gz

Download URL django-mobile-views-0.1.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ed58def5ff93a9affacab8ce8267847423e2a8c63865c679321c0472803925f5
BLAKE2b-256 checksum
How to use checksums
f2f2fecbdef5e8e2aa9bbeee36244181dadd167a8678a7e242502b5abc0a5f30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

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