{ "info": { "author": "Vladimir Dmitriev", "author_email": "vldmit@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "==============\ndjango-fspages\n==============\n\nDjango-fspages is a small application for serving django page templates from\nthe filesystem or other compatible storage. It may be used as a replacement for\n``django.contrib.flatpages``, have i18n support, is decoupled from Django ORM.\n\nApplication provide a ``fspages.views.serve`` view, which does mapping\nbetween matched path string in URL and page in the storage.\n\nEach template may be supplemented with a serialized metadata file which have a \nsame name as the template plus the entension suffix. Metadata is loaded by\ncalling metadata loader (JSON by default).\n\nIf internationalization is enabled in django settings, the view will at first \nlook for the localized version of the template by prepending the path with \nlocale name directory and fallback to default language if not translation is\navailable.\n\nRationale\n---------\n\nFor a django-powered website with dozens of semi-static web pages, usage of\nflatpages may not always be a convenient, as several problem would arise soon:\n\n- flatpages does not support i18n content. You can not by default provide a\n version of page both in English and Deutsch languages.\n\n- flatpage content is a static HTML code, you can use django template language\n there, access template context, etc. You can't fill several template's\n placeholders without creating own flatpage object.\n\n- there are two separate paths of customizing the site appearance by\n the editors - by modifying templates (served from the file system by \n default), then editing HTML content of ``FlatPage`` object (via django admin \n interface).\n\n- version control of the ``FlatPage`` objects require additional integration\n with tools like django-reversion\n\nDjango-fspages tries to solve this problems by utilizing django storage api\nfor storing pages objects and render them as the templates. Site editors \ncan edit pages as regular files with their favorite editors and version\ncontrol systems.\n\nFAQ\n---\n\nWhy not pre-render/serve static files?\n Static site generators work fine for their tasks, django-fspages is for sites\n which need to have semi-static pages (i.e. content depends on request\n parameters such as client IP address).\n\nWhy not to use template loader?\n Comparing with dumb template rendering, django-fspages support correct path\n mapping, HTML redirects, metadata processing, i18n, sitemaps.\n\nInstallation and usage\n----------------------\n\nAdd ``fspages`` to settings.INSTALLED_APPS\n\nAdd ``fspages.views.serve`` into your urlconf, example:\n\n::\n\n from django.core.files.storage import FileSystemStorage\n from fspages.storage import FSPageStorage\n \n fspages_storage = FSPageStorage(\n backend=FileSystemStorage(location='/path/to/pages/'))\n \n i18n_storage = FSPageStorage(\n backend=FileSystemStorage(location='/another/path/to/pages/'),\n index_document='index.html',\n metadata_extension='.meta.json')\n \n urlpatterns = patterns('',\n url(r'^pages/(?P.*)$', 'fspages.views.serve', {\n 'storage': fspages_storage, \n }, 'fspages'),\n )\n \n urlpatterns += i18n_patterns('',\n url(r'^i18n_pages/(?P.*)$', 'fspages.views.serve', {\n 'storage': i18n_storage, \n }, 'i18n_fspages')\n )\n\nView options\n------------\n\n``serve`` view have two required parameters, and few optional parameters:\n\npath (required)\n Path string matched in urlpattern, which to be mapped to page template. \n\nstorage (required)\n fspages.storage.FSPageStorage instance\n\nFSPageStorage constructor parameters\n------------------------------------\n\nbackend (required)\n django storage object instance, usually ``FileSystemStorage``. django-fspages\n automatically extends ``FileSystemStorage`` with additional required methods\n declared in ``fspages.storage.StorageMixin``. For other storage classes, you\n would need to provide those mixins on your own.\n\nindex_document\n When ``path`` points to the directory, view tries to open ``index_document``\n instead. Default: ``index.html``\n\nmetadata_extension\n File extension for metadata files. Default: ``.meta.json``\n\nmetadata_loader\n Callable which reveive a string with metadata file contents and needs to\n return a python dictionary. Default: json loader\n\nmetadata_defaults\n Default metadata values. Default ``fspages.views.METADATA_DEFAULTS``\n\nMetadata parameters\n-------------------\n\nEach page may be supplied with a metadata file with additional configuration\nparameters:\n\nstatus_code\n HTTP status code to respond with. Default: 200\n\ntemplate_context\n Django template context to use in addition to ``RequestContext``.\n Default: empty dictionary.\n\ncontent-type\n Custom content type. Default: mimetypes guessed type.\n\nencoding\n Page file encoding. Default: ``utf-8``.\n\nredirect_path\n Place an URL of a target page if you need to do HTTP redirect. Page file\n *SHOULD* be in place, it may be empty. Default: ``False``", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-fspages", "package_url": "https://pypi.org/project/django-fspages/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-fspages/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-fspages/0.2/", "requires_dist": null, "requires_python": null, "summary": "Django application for serving page templates from the file system", "version": "0.2" }, "last_serial": 774407, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "95a8c0b581cd4e23241da1e0a9c53d99", "sha256": "decb8f8bb2d81b867f090be1439e82331bd4f77795cb54cbfadb0f3312fbaf81" }, "downloads": -1, "filename": "django-fspages-0.2.macosx-10.8-x86_64.exe", "has_sig": false, "md5_digest": "95a8c0b581cd4e23241da1e0a9c53d99", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 75377, "upload_time": "2013-06-19T07:45:44", "url": "https://files.pythonhosted.org/packages/dc/77/296c8ac463a78f23b9362d5ab551e149b469b3360f8b6af171128097f17c/django-fspages-0.2.macosx-10.8-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "0f6ee5cc98a3a9d2e112729168d8eeba", "sha256": "42c7a883b9469933f3ed73fc2496d1f88ba590518fefff695cd37506e992424d" }, "downloads": -1, "filename": "django-fspages-0.2.tar.gz", "has_sig": false, "md5_digest": "0f6ee5cc98a3a9d2e112729168d8eeba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9902, "upload_time": "2013-06-19T07:45:39", "url": "https://files.pythonhosted.org/packages/c4/ee/d37aaaf6fc400e3a51d9a348b2360b6e65d7a6dcaf0cf82cd48e67cb12da/django-fspages-0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "95a8c0b581cd4e23241da1e0a9c53d99", "sha256": "decb8f8bb2d81b867f090be1439e82331bd4f77795cb54cbfadb0f3312fbaf81" }, "downloads": -1, "filename": "django-fspages-0.2.macosx-10.8-x86_64.exe", "has_sig": false, "md5_digest": "95a8c0b581cd4e23241da1e0a9c53d99", "packagetype": "bdist_wininst", "python_version": "any", "requires_python": null, "size": 75377, "upload_time": "2013-06-19T07:45:44", "url": "https://files.pythonhosted.org/packages/dc/77/296c8ac463a78f23b9362d5ab551e149b469b3360f8b6af171128097f17c/django-fspages-0.2.macosx-10.8-x86_64.exe" }, { "comment_text": "", "digests": { "md5": "0f6ee5cc98a3a9d2e112729168d8eeba", "sha256": "42c7a883b9469933f3ed73fc2496d1f88ba590518fefff695cd37506e992424d" }, "downloads": -1, "filename": "django-fspages-0.2.tar.gz", "has_sig": false, "md5_digest": "0f6ee5cc98a3a9d2e112729168d8eeba", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9902, "upload_time": "2013-06-19T07:45:39", "url": "https://files.pythonhosted.org/packages/c4/ee/d37aaaf6fc400e3a51d9a348b2360b6e65d7a6dcaf0cf82cd48e67cb12da/django-fspages-0.2.tar.gz" } ] }