{ "info": { "author": "David Gouldin", "author_email": "david@gould.in", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "================\r\nDjango Modernizr\r\n================\r\n\r\n`Modernizr `_ is a javascript utility that interrogates\r\na user's web browser to determine its capabilities. Unfortunately, all this\r\ndelicious data is only available client-side.\r\n\r\ndjango-modernizr is a Django Middleware that includes the Modernizr javascript\r\nand stuffs Modernizr's output into a cookie or session on the first\r\npage request.\r\n\r\n\r\nInstallation\r\n============\r\n\r\n#. Add the `modernizr` directory to your Python path.\r\n\r\n#. Add the following middleware to your project's `settings.py` file:\r\n\r\n ``'modernizr.middleware.ModenizrMiddleware',``\r\n\r\n The order of MIDDLEWARE_CLASSES is important: the Modernizr Middleware middleware\r\n must come after any other middleware that encodes the response's content\r\n (such as GZipMiddleware).\r\n\r\n Note: The modernizr code will only display itself if the mimetype of the\r\n response is either `text/html` or `application/xhtml+xml` and contains a\r\n closing `` tag.\r\n\r\n Note: Be aware of middleware ordering and other middleware that may\r\n intercept requests and return responses. Putting the modernizr\r\n middleware *after* the Flatpage middleware, for example, means modernizr\r\n will not show up on flatpages.\r\n\r\n#. Add `modernizr` to your `INSTALLED_APPS` setting so Django can find the\r\n template files associated with the modernizr.\r\n\r\n Alternatively, add the path to the modernizr templates\r\n (``'path/to/modernizr/templates'`` to your ``TEMPLATE_DIRS`` setting.)\r\n\r\nConfiguration\r\n=============\r\n\r\nDjango Modernizr has a few settings that can be set in `settings.py`\r\n(all are optional):\r\n\r\n#. `MODERNIZR_STORAGE`: set to 'cookie' or 'session'\r\n\r\n#. Cookie settings (parity to ``django.contrib.sessions`` cookie settings):\r\n\r\n * `MODERNIZR_COOKIE_NAME`: Name of the cookie. Default is 'modernizr'.\r\n * `MODERNIZR_COOKIE_AGE`: Expire time of the cookie. Default is 2 weeks.\r\n * `MODERNIZR_COOKIE_DOMAIN`: Domain name the cookie is issued on.\r\n Default is None.\r\n * `MODERNIZR_COOKIE_SECURE`: Whether or not to serve the cookie securely.\r\n Default is False.\r\n * `MODERNIZR_COOKIE_PATH`: Path the cookie is issued on. Default is '/'.\r\n\r\n#. Session settings:\r\n\r\n * `MODERNIZR_SESSION_KEY`: Session key to use for storage. Default is\r\n 'modernizr'.\r\n\r\n#. Modernizr rendering options:\r\n\r\n * `MODERNIZR_JS_URL`: URL to modernizr.js.\r\n Default is http://cachedcommons.org/cache/modernizr/1.5.0/javascripts/modernizr-min.js .\r\n * `MODERNIZR_SENTINEL_IMAGE_URL`: URL of sentinel image which includes\r\n Modernizr data. Default is '/django-modernizr-endpoint.gif'.\r\n * `MODERNIZR_INCLUDE_TAG`: A closing tag of this type will be located, and\r\n the Modernizr template will be rendered and inserted just before it.\r\n Default is 'body'.\r\n\r\nThanks\r\n======\r\n\r\nDjango Modernizr is a port of Marshall Yount's `rack-modernizr\r\n`_.\r\n\r\nPortions of code and documentation style were taken from Rob Hudson's\r\n`django-debug-toolbar\r\n`_.", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/dgouldin/django-modernizr/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dgouldin/django-modernizr", "keywords": "django modernizr", "license": "", "maintainer": "David Gouldin", "maintainer_email": "david@gould.in", "name": "django-modernizr", "package_url": "https://pypi.org/project/django-modernizr/", "platform": "", "project_url": "https://pypi.org/project/django-modernizr/", "project_urls": { "Download": "https://github.com/dgouldin/django-modernizr/tarball/master", "Homepage": "https://github.com/dgouldin/django-modernizr" }, "release_url": "https://pypi.org/project/django-modernizr/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Django port of Marshall Yount's rack-modernizr (https://github.com/marshally/rack-modernizr/)", "version": "0.1.0" }, "last_serial": 224615, "releases": { "0.1.0": [] }, "urls": [] }