Commits

Roman Lyashov committed eab4407

fixed bug, updated version and README

Comments (0)

Files changed (3)

  
 MOBI_USER_AGENT_IGNORE_LIST = ['ipad',]
 
+If you want to distinguish tablet devices from phones, then set MOBI_DETECT_TABLET = True and use request.tablet attribute
+
+{% if not request.mobile or request.tablet %}
+	<p>This section enabled only for descktop and tablets</p>
+{% endif %}
+
+
+
+
 Using the mobi.MobileRedirectMiddleware Middleware
 ---------------------------------------------------
 This middleware will scan all incoming requests to see if it is a mobile device, if so it will redirect the request to a different URL. This is good if you want to force all mobile traffic to a mobile only version of your site.

mobi/useragents.py

     
     # it wasn't in the cache, get it from the file, then store in the cache
     with open(os.path.join(os.path.dirname(__file__), file_name)) as f:
-        ss = f.readlines()
+        ss = f.read().splitlines()
 
     agents = [s.strip() for s in ss if s and not s.startswith('#')]
     # store to the cache
 
 setup(
     name='django-mobi',
-    version='0.1.6',
+    version='0.1.7',
     description='Django middleware and view decorator to detect phones and small-screen devices',
     maintainer='Ken Cochrane',
     maintainer_email='KenCochrane@gmail.com',