{ "info": { "author": "Alisue", "author_email": "lambdalisue@hashnote.net", "bugtrack_url": null, "classifiers": [], "description": "django-roughpages\n==========================\n.. image:: https://img.shields.io/travis/lambdalisue/django-roughpages/master.svg\n :target: http://travis-ci.org/lambdalisue/django-roughpages\n :alt: Build status\n\n.. image:: https://img.shields.io/scrutinizer/g/lambdalisue/django-roughpages/master.svg\n :target: https://scrutinizer-ci.com/g/lambdalisue/django-roughpages/inspections\n :alt: Code quality\n\n.. image:: https://img.shields.io/coveralls/jekyll/jekyll/master.svg\n :target: https://coveralls.io/r/lambdalisue/django-roughpages/\n :alt: Coverage\n\n.. image:: https://requires.io/github/lambdalisue/django-roughpages/requirements.svg?branch=master\n :target: https://requires.io/github/lambdalisue/django-roughpages/requirements\n :alt: Requirements\n\n.. image:: https://img.shields.io/pypi/v/django-roughpages.svg\n :target: https://pypi.python.org/pypi/django-roughpages/\n :alt: Version\n\n.. image:: https://img.shields.io/pypi/status/django-roughpages.svg\n :target: https://pypi.python.org/pypi/django-roughpages/\n :alt: Status\n\n.. image:: https://img.shields.io/pypi/l/django-roughpages.svg\n :target: https://pypi.python.org/pypi/django-roughpages/\n :alt: License\n\n.. image:: https://img.shields.io/pypi/pyversions/django-roughpages.svg\n :target: https://pypi.python.org/pypi/django-roughpages/\n :alt: Python versions\n\n.. image:: https://img.shields.io/badge/django-1.7--1.10-blue.svg?style=flat-square\n :alt: Django versions\n\nAn template based the flatpages_ like app.\nNot like django's flatpages app, django-roughpages render a template file which\ndetermined from the accessed URL.\nIt is quite combinient when you want to render simple static page.\nYou do not need to prepare ``urls.py`` or ``views.py`` anymore for that kind\nof simple static page.\n\ndjango-roughpages call ``roughpages.views.roughpage`` view with the accessed\nURL when django raise ``Http404`` exception.\nThe view automatically find the corresponding template file from ``roughpages``\ndirectory in one of your template directories.\nAssume if the user accessed http://localhost/foo/bar/hoge/.\nIf there is no urls pattern patched with the URL, django-roughpages try to find\ncorresponding template file such as ``templates/roughpages/foo/bar/hoge.html``.\nIf django-roughpages find the corresponding template file, it will render the\ntemplate and return the ``HttpResponse``, otherwise it re-raise ``Http404``\nexception.\n\nYou can complicatedly select the corresponding template file.\ndjango-roughpages determine the filename with a backend system.\nThe default backend is ``roughpages.backends.AuthTemplateFilenameBackend`` and\nit prefer ``hoge.anonymous.html`` or ``hoge.authenticated.html`` than \n``hoge.html`` depends on the accessed user authentication state.\nThus you can simply prepare the page for authenticated user as\n``.authenticated.html`` and for anonymous user as\n``.anonymous.html``.\nNote that the filename which contains ``'.'`` is not allowed thus user cannot \naccess ``hoge.authenticated.html`` with a url like ``/hoge.authenticated`` to prevent unwilling file acccess.\n\nYou can control the backend behavior with making a custom backend.\nTo make a custom backend, you need to inherit\n``roughpages.backends.TemplateFilenameBackendBase`` and override\n``prepare_filenames(self, filename, request)`` method.\nThe method receive an original filename and ``HttpRequest`` instance and\nmust return a filename list.\nThe django-roughpages then try to load template file from the beginning of\nthe list, thus the order of the appearance is the matter.\n\n.. _flatpages: https://docs.djangoproject.com/en/dev/ref/contrib/flatpages/\n\nDocumentation\n-------------\nhttp://django-roughpages.readthedocs.org/en/latest/\n\nInstallation\n------------\nUse pip_ like::\n\n $ pip install django-roughpages\n\n.. _pip: https://pypi.python.org/pypi/pip\n\nUsage\n-----\n\nConfiguration\n~~~~~~~~~~~~~\n1. Add ``roughpages`` to the ``INSTALLED_APPS`` in your settings\n module\n\n .. code:: python\n\n INSTALLED_APPS = (\n # ...\n 'roughpages',\n )\n\n2. Add our extra fallback middleware\n\n Django >= 1.10\n\n .. code:: python\n\n MIDDLEWARE = (\n # ...\n 'roughpages.middleware.RoughpageFallbackMiddleware',\n )\n\n Django < 1.10\n\n .. code:: python\n\n MIDDLEWARE_CLASSES = (\n # ...\n 'roughpages.middleware.RoughpageFallbackMiddleware',\n )\n\n3. Create ``roughpages`` directory in one of your template directories\n specified with ``settings.TEMPLATE_DIRS``\n\n\nQuick tutorial\n~~~~~~~~~~~~~~~\n1. Create ``roughpages/foo/bar/hoge.html`` as follow\n\n .. code:: html\n\n \n \n This is Hoge\n \n \n\n2. Run syncdb and Start development server with\n ``python manage.py syncdb; python manage.py runserver 8000``\n\n3. Access http://localhost:8000/foo/bar/hoge/ and you will see \"This is Hoge\"\n\n4. Create ``roughpages/foo/bar/piyo.anonymous.html`` as follow\n\n .. code:: html\n\n \n \n This is Piyo Anonymous\n \n \n\n5. Create ``roughpages/foo/bar/piyo.authenticated.html`` as follow\n\n .. code:: html\n\n \n \n This is Piyo Authenticated\n \n \n\n6. Access http://localhost:8000/foo/bar/piyo/ and you will see\n \"This is Piyo Anonymous\"\n\n7. Access http://localhost:8000/admin/ and login as admin user.\n\n8. Access http://localhost:8000/foo/bar/piyo/ and you will see\n \"This is Piyo Authenticated\"\n\n\n.. Note::\n\n Any dots ('.') in a last part of URL is replaced to underscore ('_') to prevent a security risk.\n See https://github.com/lambdalisue/django-roughpages/issues/3", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/lambdalisue/django-roughpages/tarball/master", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lambdalisue/django-roughpages", "keywords": "django flatpage template", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-roughpages", "package_url": "https://pypi.org/project/django-roughpages/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-roughpages/", "project_urls": { "Download": "https://github.com/lambdalisue/django-roughpages/tarball/master", "Homepage": "https://github.com/lambdalisue/django-roughpages" }, "release_url": "https://pypi.org/project/django-roughpages/1.0.0/", "requires_dist": null, "requires_python": null, "summary": "An template based flatpage like app of Django.", "version": "1.0.0" }, "last_serial": 2635352, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e4766ecdd0222c978581dff3116a2ccd", "sha256": "71547569faafd0c9848212baa1f82cff29aa760e7278b4a438d550e60628bf40" }, "downloads": -1, "filename": "django-roughpages-0.1.0.tar.gz", "has_sig": false, "md5_digest": "e4766ecdd0222c978581dff3116a2ccd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10397, "upload_time": "2014-06-05T08:35:53", "url": "https://files.pythonhosted.org/packages/9f/95/23bf9cac83491b2a5974c5925719357d58a43d30f9b1ee91f7b10ccb6665/django-roughpages-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "e33a0c5fafc73ee072bbdddfb9d7b24e", "sha256": "1636353923d2015d11e7c436af1adf6bc7714526206bedf159ec0f103bf9d857" }, "downloads": -1, "filename": "django-roughpages-0.1.1.tar.gz", "has_sig": false, "md5_digest": "e33a0c5fafc73ee072bbdddfb9d7b24e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11078, "upload_time": "2014-06-05T12:44:37", "url": "https://files.pythonhosted.org/packages/d1/1d/ab14ed0c3fe719b5983d41166ec774b38f93ca80f5004b51e027cbf07188/django-roughpages-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "6cfbcd55895cdb2ba580127732206633", "sha256": "1d21f20af4d0df281733aa6b4a77a4e0926996bdfe077f4f9d1d04e3cdd0e106" }, "downloads": -1, "filename": "django-roughpages-0.1.2.tar.gz", "has_sig": false, "md5_digest": "6cfbcd55895cdb2ba580127732206633", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11462, "upload_time": "2014-07-15T09:57:59", "url": "https://files.pythonhosted.org/packages/79/2f/5dc62dce2b0239f9a2a0dd4283f48647fa24d1a99763403c5e94f11f34e0/django-roughpages-0.1.2.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f04550761f831b923861fa0493cd3493", "sha256": "bbbd556754d9a3a098b1b54a9ef016204307988baaf75b35d70b8298dd01adfd" }, "downloads": -1, "filename": "django-roughpages-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f04550761f831b923861fa0493cd3493", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9489, "upload_time": "2016-10-02T13:33:44", "url": "https://files.pythonhosted.org/packages/f8/80/652322484b0aaaa7dee0d51b580f4506a15d3967c81d301f64fd804b8572/django-roughpages-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "1e9d7f121b9b8ce405445d062f8af10b", "sha256": "b1b904f5028ed6034d0095566497b02d54682b38e581644f008cd07895564d89" }, "downloads": -1, "filename": "django_roughpages-0.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "1e9d7f121b9b8ce405445d062f8af10b", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 17707, "upload_time": "2016-11-13T06:05:17", "url": "https://files.pythonhosted.org/packages/cd/a8/304b174159336e525cd7f4e6d84171a17da354f4000f5c6d95967cbf2163/django_roughpages-0.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29870b6d217b04f1d167d5652e0eb548", "sha256": "ad854a4923e7ef5d2a18e5ee30fc4d13f909fd96b37c1e8e683cc9c1d1d2cac5" }, "downloads": -1, "filename": "django-roughpages-0.3.0.tar.gz", "has_sig": false, "md5_digest": "29870b6d217b04f1d167d5652e0eb548", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10426, "upload_time": "2016-11-13T06:05:28", "url": "https://files.pythonhosted.org/packages/fd/f9/20d47c4866297d7307432b912d306d2620bac123fe68bde2fe34dd12005c/django-roughpages-0.3.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "1f6110cb937e41d4199275c4136a8d45", "sha256": "755d69bd600d70708fb2cf729ae2a9f5a42cb13d93d72b362ffe55fa2af5965f" }, "downloads": -1, "filename": "django-roughpages-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1f6110cb937e41d4199275c4136a8d45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10347, "upload_time": "2017-02-11T14:56:57", "url": "https://files.pythonhosted.org/packages/7b/54/a4eec005276a52df32a811d2d002f89e60d5d01929af807ff6b73e0dfe7e/django-roughpages-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1f6110cb937e41d4199275c4136a8d45", "sha256": "755d69bd600d70708fb2cf729ae2a9f5a42cb13d93d72b362ffe55fa2af5965f" }, "downloads": -1, "filename": "django-roughpages-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1f6110cb937e41d4199275c4136a8d45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10347, "upload_time": "2017-02-11T14:56:57", "url": "https://files.pythonhosted.org/packages/7b/54/a4eec005276a52df32a811d2d002f89e60d5d01929af807ff6b73e0dfe7e/django-roughpages-1.0.0.tar.gz" } ] }