{ "info": { "author": "Alisue", "author_email": "lambdalisue@hashnote.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "``django-mfw`` is a framework for developping mobile site with Django. The\nfollowing feature is available\n\n- Detect accessing device via HTTP_USER_AGENT and determine the device can\n handle cookie or not.\n\n- Non cookie based Session and Csrf protection for the devices which cannot\n handle cookies.\n\n- Dynamically change loading template via the device information. That's\n mean you can prepare the HTML template for each device (flavour template\n system)\n\n- Encode request and response via detected device encoding. It is required\n because some Japanese mobile phone cannot handle UTF-8\n\n- Translate Japanese Emoji in request and response to proper character code\n or image for PC.\n\n\n.. Note::\n This is under development. The codes below may not work.\n\nInstall\n=================================================\n::\n\n\tsudo pip install django-mfw\n\t\nor::\n\n\tsudo pip install git+git://github.com/lambdalisue/django-mfw.git#egg=django-mfw\n\n\nRequired (Automatically installed)\n=================================================\n\n+\t`e4u `_ (emoji4unicode bundle framework)\n\n\nQuick tutorial\n=================================================\n\n1.\tAdd ``mfw`` and ``mfw.contrib.emoji`` to your ``INSTALL_APPS`` settings in ``settings.py``\n\n2. Add ``mfw.middleware.device.RequestDeviceDetectionMiddleware`` to **the first\n item** of ``MIDDLEWARE_CLASSES`` in ``settings.py`` and\n ``mfw.middleware.device.ResponseDeviceDetectionMiddleware`` to **the last\n item** of\n\n .. Note::\n The following django-mfw middlewares are assumed that this middleware\n has called before they are called.\n\n3.\tAdd ``mfw.middleware.session.SessionMiddleware`` and ``mfw.middleware.csrf.CsrfViewMiddleware``\n\tto your ``MIDDLEWARE_CLASSES`` setting and *comment out* existing middlewares.\n\n4.\tAdd ``mfw.contrib.emoji.middleware.DeviceEmojiTranslationMiddleware`` and\n\t``mfw.middleware.flavour.DeviceFlavourDetectionMiddleware`` to your ``MIDDLEWARE_CLASSES`` setting.\n\n5.\tAdd ``mfw.template.loaders.flavour.Loader`` to **the first item** of ``TEMPLATE_LOADERS`` setting.\n\n6.\tAdd ``mfw.context_processors.device`` and ``mfw.context_processors.flavour`` to your ``TEMPLATE_CONTEXT_PROCESSORS`` setting.\n\nThe code below describe sample settings. See `settings.py `_ for more detail.::\n\n\t# List of callables that know how to import templates from various sources.\n\tTEMPLATE_LOADERS = (\n\t 'mfw.template.loaders.flavour.Loader',\n\t 'django.template.loaders.filesystem.Loader',\n\t 'django.template.loaders.app_directories.Loader',\n\t# 'django.template.loaders.eggs.Loader',\n\t)\n\t\n\tMIDDLEWARE_CLASSES = (\n\t 'mfw.middleware.device.RequestDeviceDetectionMiddleware',\n\n\t 'django.middleware.common.CommonMiddleware',\n\t #'django.contrib.sessions.middleware.SessionMiddleware',\n\t 'mfw.middleware.session.SessionMiddleware',\n\t #'django.middleware.csrf.CsrfViewMiddleware',\n\t 'mfw.middleware.csrf.CsrfViewMiddleware',\n\t 'django.contrib.auth.middleware.AuthenticationMiddleware',\n\t 'mfw.contrib.emoji.middleware.DeviceEmojiTranslationMiddleware',\n\t 'mfw.middleware.flavour.DeviceFlavourDetectionMiddleware',\n\n\t 'mfw.middleware.device.ResponseDeviceDetectionMiddleware',\n\t)\n\t\n\tTEMPLATE_CONTEXT_PROCESSORS = (\n\t \"django.core.context_processors.auth\",\n\t \"django.core.context_processors.debug\",\n\t \"django.core.context_processors.i18n\",\n\t \"django.core.context_processors.media\",\n\t \"django.core.context_processors.request\",\n\t \"mfw.context_processors.device\",\n\t \"mfw.context_processors.flavour\",\n\t)\n\nUsage\n===============================================\n\nDevice detection\n----------------------------------------------------\nrequest device is detected with ``mfw.middleware.device.DeviceDetectionMiddleware`` and stored in ``request.device``\nthe ``device`` instance has following attributes\n\n\n``device.support_cookie``\n is the device support cookie or not.\n\n``device.kind``\n A kind of this device. It is used for flavour template system.\n\n``device.name``\n A name of this device. It is used for flavour template system.\n\n``device.model``\n A model name of this device. It is used for flavour template system.\n\n``device.version``\n A version name of this device. It is used for flavour template system.\n\n``device.encoding``\n A recommended encoding for the device. It is used to encode the request/response\n\n``device.carrier (additional)``\n An attribute which Mobilephone device has. the carrier name of the device.\n\n``device.uid (additional)``\n An attribute which Mobilephone device has. User id which is passed from\n carrier server.\n\n``device.reliable (additional)``\n An attribute which Mobilephone device has. If ``False`` then the\n HTTP_USER_AGENT might be modified thus passed user id is not reliable\n enough.\n\n\n\nNon cookie based Session and CSRF protection\n----------------------------------------------------\nDjango default session is saved on cookie because of security reason. However some device doesn't support cookie\nso ``mfw.middleware.session.SessionMiddleware`` use carrier's UID and django cache system for saving session.\n\nthe middleware never try to use carrier's UID for device which support cookie. it is only for the device which doesn't support cookie\nand commonly such device has carrier's UID. Because of security, device accessed from out of carrier's CIDR\nis not trusted so it cannot save session if cookie is not supported.\n\n.. Note::\n To accept non cookie based session for the device accessed from out of carrier's CIDR, set ``MFW_IGNORE_NON_RELIABLE_MOBILE`` to ``False``\n but **IT IS STRONGLY NOT RECOMMENDED**\n\n\nUnicode emoji and Japanese carrier emoji conversion\n----------------------------------------------------\n``mfw.contrib.emoji.middleware.DeviceEmojiTranslationMiddleware`` care it. it detect device and automatically translate unicode emoji to\ncarrier's encoded emoji in response. That's why you do not need to care the code of emoji. Just write emoji as unicode emoji then\nmiddleware translate everything correctly and encode response to carrier's encoding\n\nIncoming translation is also handled the middleware. if ``request.GET`` or ``request.POST`` has carrier emoji, the middleware automatically\ntranslate the carrier emojis to unicode emojis and decode value to unicode. \n\nUnicode emoji is found on http://www.unicode.org/~scherer/emoji4unicode/snapshot/full.html . this is a part of `emoji4unicode `_ project\nand translation method is using conversion table of it. see `e4u `_ for more detail.\n\n\nFlavour template system\n----------------------------------------\n``mfw.middleware.flavour.DeviceFlavourDetectionMiddleware`` detect device and automatically create **flavour** for device.\nthe flavour is used for prefix of template_name. so if the flavour is ``smartphone/iphone/1.3`` and called template name is ``blogs/post_detail.html``\nthen ``mfw.template.loaders.flavour.Loader`` will try to load the file listed below with template loaders listed in ``TEMPLATE_LOADERS`` except oneself.\n\n1.\t``TEMPLATE_DIRECTORY/smartphone/iphone/1.3/blogs/post_detail.html``\n\n2.\t``TEMPLATE_DIRECTORY/smartphone/iphone/blogs/post_detail.html``\n\n3.\t``TEMPLATE_DIRECTORY/smartphone/blogs/post_detail.html``\n\n4.\t``TEMPLATE_DIRECTORY/blogs/post_detail.html``\n\n``mfw.template.loaders.flavour.Loader`` is bundle loader and loading method is depended with template loaders listed in ``TEMPLATE_LOADERS``\nso make sure you listed correct template loader in ``TEMPLATE_LOADERS``\n\n\nSpecial thanks\n==================================================================\ndjango-mfw's concept is inspired by `django-bpmobile `_\n`django-mobile `_ and `emoji4unicode `_", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/lambdalisue/django-mfw/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lambdalisue/django-mfw", "keywords": "django mobile smartphone emoji device detection dynamic template", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-mfw", "package_url": "https://pypi.org/project/django-mfw/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-mfw/", "project_urls": { "Download": "https://github.com/lambdalisue/django-mfw/tarball/master", "Homepage": "https://github.com/lambdalisue/django-mfw" }, "release_url": "https://pypi.org/project/django-mfw/0.4.1/", "requires_dist": null, "requires_python": null, "summary": "Django framework for mobilephone/smartphone site", "version": "0.4.1" }, "last_serial": 790076, "releases": { "0.1rc1": [], "0.1rc2": [ { "comment_text": "", "digests": { "md5": "5cfe289050d42d6176ff52aabfa62bfd", "sha256": "15b396c514b52e1a1277a7076144a5925c34af5b92d4901b3826e152dcb0fce8" }, "downloads": -1, "filename": "django_mfw-0.1rc2-py2.7.egg", "has_sig": false, "md5_digest": "5cfe289050d42d6176ff52aabfa62bfd", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 28429, "upload_time": "2011-06-11T06:13:37", "url": "https://files.pythonhosted.org/packages/ab/31/d2c74a6e1bfd01ecb4bdad1809f6f8daaeb12a5358778774424fada1cfc4/django_mfw-0.1rc2-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "a5d003f892e3c0981b3209a8743c9ab2", "sha256": "0d8447170943eb9055ccc5cc64b56ef7222660674462678e2fa495417f7bedb9" }, "downloads": -1, "filename": "django-mfw-0.1rc2.tar.gz", "has_sig": false, "md5_digest": "a5d003f892e3c0981b3209a8743c9ab2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18762, "upload_time": "2011-06-11T06:13:21", "url": "https://files.pythonhosted.org/packages/aa/f5/4e9b738ecac3fe4eeb1b1b07cd11f97f3a122e91a9e68db479985a17d1c4/django-mfw-0.1rc2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "1b6aec795b2597f096f26cde55e04b88", "sha256": "5dc9417c64bbcf296aae50e3d0a77cc555f4789fcfdea31ab6dbe1325d442035" }, "downloads": -1, "filename": "django-mfw-0.2.0.tar.gz", "has_sig": false, "md5_digest": "1b6aec795b2597f096f26cde55e04b88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 188768, "upload_time": "2012-03-05T21:52:13", "url": "https://files.pythonhosted.org/packages/d8/95/3f411beb79d25bac31590fe2aee18cab6e35aaeb588110c6f7539db092f8/django-mfw-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "e782e6dfdb1691f1952add36895d0a22", "sha256": "785f43fc32745cd6ae5c4ea591343ea73c3fc9609d9812a877d99e2fd1049ba7" }, "downloads": -1, "filename": "django-mfw-0.3.0.tar.gz", "has_sig": false, "md5_digest": "e782e6dfdb1691f1952add36895d0a22", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 217351, "upload_time": "2012-03-06T19:38:30", "url": "https://files.pythonhosted.org/packages/ef/9f/ec78aee3780e82ef9c175885f48c35ea224d64be7e1b42cd38f8b25a51e7/django-mfw-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "00195f58bf53b6464ded0719aefc86a8", "sha256": "2d16e893f433cbfc6a275dfaf6160313fcce14505821a3e857d960364a08fa5b" }, "downloads": -1, "filename": "django-mfw-0.3.1.tar.gz", "has_sig": false, "md5_digest": "00195f58bf53b6464ded0719aefc86a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 217516, "upload_time": "2012-03-07T04:40:02", "url": "https://files.pythonhosted.org/packages/60/1c/56d57a29a3e48e01ec5068e42ef81a0bf58a3153dd528dcb826dbffbedeb/django-mfw-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "026b9b0e5e435cb3425398f735230416", "sha256": "c6cce106b29fa4846cc38f1e85bd1eefac1242c2decc725800e4595b63985bc6" }, "downloads": -1, "filename": "django-mfw-0.3.2.tar.gz", "has_sig": false, "md5_digest": "026b9b0e5e435cb3425398f735230416", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 217537, "upload_time": "2012-03-07T04:46:29", "url": "https://files.pythonhosted.org/packages/71/ad/a0294aa8379de11e10c3e478bfe9d7c42ea333571ce185deaa32f21f5ffe/django-mfw-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "b14ac2d3c58a9618b820e0ea0a209964", "sha256": "7cdd43018c41a2ac68aee90261bbfcc26e93414ca2c2de14277268898b1c23b7" }, "downloads": -1, "filename": "django-mfw-0.3.3.tar.gz", "has_sig": false, "md5_digest": "b14ac2d3c58a9618b820e0ea0a209964", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218420, "upload_time": "2012-03-08T06:22:53", "url": "https://files.pythonhosted.org/packages/f0/3c/33c6c740d76ed20a96fc147d6a34ce203e523d368611b0482f50228b72a9/django-mfw-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "8c338b0b15464abeace2fea0e71059e3", "sha256": "476b77f96c7c8f64670d3f57dec2d6ac123e2f2950e76b3f77e274ce8e85c967" }, "downloads": -1, "filename": "django-mfw-0.3.4.tar.gz", "has_sig": false, "md5_digest": "8c338b0b15464abeace2fea0e71059e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 218508, "upload_time": "2012-03-08T20:34:45", "url": "https://files.pythonhosted.org/packages/79/6a/ab6b07c0ee41e705ea6c01e2623e238fb8bb931ae953dc7768c256cff98a/django-mfw-0.3.4.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "4464a56be23f8cbf62c9a59387978820", "sha256": "9b59ebaac007c2ab886cdedda5930f1a2254ad7de432530e1f2880e22a170aed" }, "downloads": -1, "filename": "django-mfw-0.4.0.tar.gz", "has_sig": false, "md5_digest": "4464a56be23f8cbf62c9a59387978820", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 219545, "upload_time": "2012-03-13T08:16:46", "url": "https://files.pythonhosted.org/packages/fc/4b/61f7f0968cfbad664baac7e94ebfac883b227c2ba0e66a30e9ea20c2c4f2/django-mfw-0.4.0.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "f3ef931498dfea2057b7de57cf9f6c8c", "sha256": "e725ae904dc2aa11f71c4fdd5022a8e03a8b2ed64f1a5847476451d95abc1824" }, "downloads": -1, "filename": "django-mfw-0.4.1.tar.gz", "has_sig": false, "md5_digest": "f3ef931498dfea2057b7de57cf9f6c8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 219554, "upload_time": "2012-03-13T08:53:22", "url": "https://files.pythonhosted.org/packages/04/f7/c785d883eb9db8f4c57bb5730d1ae95020a7f8f8ed41f338a97c81dd3a3e/django-mfw-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f3ef931498dfea2057b7de57cf9f6c8c", "sha256": "e725ae904dc2aa11f71c4fdd5022a8e03a8b2ed64f1a5847476451d95abc1824" }, "downloads": -1, "filename": "django-mfw-0.4.1.tar.gz", "has_sig": false, "md5_digest": "f3ef931498dfea2057b7de57cf9f6c8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 219554, "upload_time": "2012-03-13T08:53:22", "url": "https://files.pythonhosted.org/packages/04/f7/c785d883eb9db8f4c57bb5730d1ae95020a7f8f8ed41f338a97c81dd3a3e/django-mfw-0.4.1.tar.gz" } ] }