{ "info": { "author": "Open-E, Inc.", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django :: 1.10", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP" ], "description": "django-powerpages\n=================\n\n.. image:: https://api.travis-ci.org/Open-E-WEB/django-powerpages.svg?branch=master\n :target: https://travis-ci.org/Open-E-WEB/django-powerpages\n.. image:: https://img.shields.io/pypi/v/django-powerpages.svg\n :target: https://pypi.python.org/pypi/django-powerpages\n.. image:: https://coveralls.io/repos/github/Open-E-WEB/django-powerpages/badge.svg?branch=master\n :target: https://coveralls.io/github/Open-E-WEB/django-powerpages?branch=master\n\n\nDeveloper-friendly, simple CMS for Django, \"flatpages on steroids\".\n\n\nFeatures\n--------\n\n- edit pages in Admin using syntax highlighting - HTML, CSS, JavaScript, Django template language\n- edit pages as files using your favourite text editor or IDE\n- on demand synchronization of pages between database and file system using Django commands\n- integration with Django's template system\n- attach custom server-side logic to a page through configurable *Page Processors*\n- sitemap.xml\n\n\nInstallation\n------------\n\nInstall package using pip:\n\n.. code-block:: python\n\n pip install django-powerpages\n\n\nAdd ``'powerpages'`` to ``INSTALLED_APPS`` in your settings module:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n ...\n 'powerpages',\n )\n\nDefine ``POWER_PAGES`` setting:\n\n.. code-block:: python\n\n POWER_PAGES = {\n # absolute path to directory, where page files are located:\n 'SYNC_DIRECTORY': '/path/to/directory/'\n }\n\nInclude app's URLs at the end of your urlconf:\n\n.. code-block:: python\n\n urlpatterns = [\n ...\n url(r'', include('powerpages.urls', namespace='powerpages')),\n ]\n\nAdd ``powerpages.loader.WebsiteLoader`` at end of your ``loaders`` in\n``TEMPLATES -> OPTIONS`` setting:\n\n.. code-block:: python\n\n TEMPLATES = [\n {\n ...\n 'OPTIONS': {\n ...\n 'loaders': [\n 'django.template.loaders.filesystem.Loader',\n 'django.template.loaders.app_directories.Loader',\n # Database template loader for powerpages app\n 'powerpages.loader.WebsiteLoader',\n ],\n ...\n }\n ...\n }\n ]\n\nRun migrations:\n\n.. code-block:: python\n\n python manage.py migrate\n\n\nUsage\n-----\n\n\nAdmin screenshots:\n~~~~~~~~~~~~~~~~~~\n\n.. image:: powerpages-scr-01.png\n\n.. image:: powerpages-scr-02.png\n\n\nEdit pages using Admin\n~~~~~~~~~~~~~~~~~~~~~~\n\nAdmin interface allows to edit pages using the following fields:\n\n- *URL* - unique address of every page\n- *Alias* - optional code name for page to be used to resolve it's URL address\n- *Title*, *Description*, *Keywords* - convenience fields to work with meta-tags\n- *Template* - page's content as a Django template source\n- *Page Processor* and *Page Processor Config* - options to assign and customize server-side logic\n\nURL addresses of pages can be reversed in templates by using ``{% page_url alias %}``.\nThis template tag can also reverse URLs of regular Django views.\n\nPage templates work as regular Django's templates with few modifications:\n\n1. ``{% extends ... %}`` tag should not be used:\n\n- by default each template inherits from template of parent page\n- parent template can be overwritten by providing ``base template`` option to the page processor config\n\n2. ``{% load ... %}`` tag is not necessary:\n\n- template tag libraries from ``settings.POWER_PAGES['TAG_LIBRARIES']`` are loaded automatically\n- additional libraries may be provided using ``tag libraries`` in page processor config\n\n*Page Processor* field allows to select a Python class responsible for processing requests for current page.\nPage processor can be configured using YAML config in *Page Processor Config* field.\nDefault value, ``powerpages.DefaultPageProcessor`` just renders page content and returns the output as ``200 OK`` response.\nOther predefined options are:\n\n- ``powerpages.RedirectProcessor`` - creates ``301 Moved Permanently`` or ``302 Found`` response depending on boolean ``permanent`` parameter. Redirect location is provided by URL (parameter ``to url``), view name (``to name``) or Page alias (``to alias``).\n- ``powerpages.NotFoundProcessor`` - generates ``404 Not Found`` response.\n\nExample configuration of default page processor:\n\n.. code-block:: python\n\n base template: myapp/base.html\n context processors:\n - myapp.context_processors.context\n tag libraries:\n - myapp_tags\n headers: {x-magic-id: '42'}\n cache: 300\n cache for user: true\n sitemap: false\n\nTo define a custom page processor you may create a subclass of ``DefaultPageProcessor``\ninside ``page_processors.py`` file in your app:\n\n.. code-block:: python\n\n # myapp/page_processors.py\n from powerpages.page_processors import DefaultPageProcessor\n from powerpages.page_processor_registry import register\n\n class MyPageProcessor(DefaultPageProcessor):\n\n def process_request(self, request, extra_context=None):\n \"\"\"Process a request and create HTTP Response.\"\"\"\n # Put your custom view logic here\n\n register(MyPageProcessor)\n\n\nBrowse website in \"edit mode\"\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nButton \"Edit mode\" in Admin allows to show information about current page while browsing the website.\nUser enables \"Edit mode\" for current session in Admin using *Edit mode* button.\nThis mode works only if template tag ``{% current_page_info %}`` has been added to the template source.\n\n\nFile-Database Synchronization\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nExport pages from database to file system is done by ``website_dump`` command.\nAll pages are saved as structure of files and directories inside ``settings.POWER_PAGES['SYNC_DIRECTORY']``.\nExported pages can be modified using text editor and later loaded again into the database.\n\n.. code-block:: python\n\n python manage.py website_dump\n\nExample structure of output directory:\n\n.. code-block:: python\n\n _index_.page\n about-us/_index_.page\n about-us/contact.page\n download.page\n robots.txt\n\nEach of dumped files has the following structure:\n\n.. code-block:: python\n\n {\n ... page fields as JSON\n }\n ## TEMPLATE SOURCE: ##\n ... template content (plain text)\n\nImport pages from directory into database is done using ``website_load`` command.\n\n.. code-block:: python\n\n python manage.py website_load\n\nBoth website commands accept a variety of options to tweak their behaviour.\nFor the full list of options, use ``--help``.\n\n\nXML Sitemaps\n~~~~~~~~~~~~\n\n``django-powerpages`` comes with a system for defining XML Sitemaps (alternative to ``django.contrib.sitemaps``).\nBy default, all accessible pages are listed as URLs in ``sitemap.xml``.\nTo remove a page from the sitemap user may add the following option to page processor config:\n\n.. code-block:: python\n\n sitemap: false\n\n\n``sitemap`` option may be used to modify page's sitemap params:\n\n.. code-block:: python\n\n sitemap: {changefreq: 'daily', priority: 0.9}\n\nDefault values for ``changefreq`` and ``priority`` for all URLs can be set using ``settings.POWER_PAGES``:\n\n.. code-block:: python\n\n POWER_PAGES = {\n # (...)\n 'SITEMAP_DEFAULT_CHANGEFREQ': 'weekly',\n 'SITEMAP_DEFAULT_PRIORITY': 0.7,\n }\n\nTo add custom URLs from your app to the sitemap you may define and register\na subclass of ``Sitemap`` or ``ModelSitemap`` class inside ``sitemap.py`` file in your app:\n\n.. code-block:: python\n\n # myapp/sitemap.py\n from powerpages import sitemap_config\n from myapp.models import MyModel\n\n class MyModelSitemap(sitemap_config.ModelSitemap):\n \"\"\"Sitemap config for Storage Powered by Open-E document files\"\"\"\n queryset = MyModel.objects.all()\n\n class MyStaticSitemap(sitemap_config.Sitemap):\n items = (\n {'location': sitemap_config.NamedURL('myview')},\n {'location': sitemap_config.NamedURL('myview2', param='value')}\n )\n\n sitemap_config.sitemaps.add(MyModelSitemap)\n sitemap_config.sitemaps.add(MyStaticSitemap)\n\n\nRequirements\n------------\n\nPython: 2.7, 3.4, 3.5\n\nDjango: 1.9, 1.10", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Open-E-WEB/django-powerpages", "keywords": "django cms web", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-powerpages", "package_url": "https://pypi.org/project/django-powerpages/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-powerpages/", "project_urls": { "Homepage": "https://github.com/Open-E-WEB/django-powerpages" }, "release_url": "https://pypi.org/project/django-powerpages/0.0.8/", "requires_dist": [ "PyYAML (==3.11)" ], "requires_python": "", "summary": "Developer-friendly, simple CMS for Django, \"flatpages on steroids\".", "version": "0.0.8" }, "last_serial": 2880131, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "87048988995406bbedb9f793d93e53dc", "sha256": "5f4f92f299934b3003f12cafb4a89eb5ef751586372fbcde853e1fa5d8681a29" }, "downloads": -1, "filename": "django-powerpages-0.0.1.tar.gz", "has_sig": false, "md5_digest": "87048988995406bbedb9f793d93e53dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1097011, "upload_time": "2016-10-09T21:40:30", "url": "https://files.pythonhosted.org/packages/ea/55/0f92dd492d66f0a1fb6391581bb7409ab2a8bf0326b8d248b3177773e59b/django-powerpages-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "73db8c184af22dbd1984b8273e677390", "sha256": "5dc2e21dc4263b477582887c9ed7d280e2bb26a101f39cfae9cd45037611b5c4" }, "downloads": -1, "filename": "django-powerpages-0.0.2.tar.gz", "has_sig": false, "md5_digest": "73db8c184af22dbd1984b8273e677390", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1234232, "upload_time": "2016-10-14T12:02:06", "url": "https://files.pythonhosted.org/packages/b6/1b/fddb2d1728a6103f243fc5445668e479963f3fe085114f8bb44c548dafac/django-powerpages-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "e0186cab9b841a745144e0155c37b375", "sha256": "2e18e4ad608c0634087deadcb5cc93fd6e27098b20ddff131f02a82c8e967f2e" }, "downloads": -1, "filename": "django_powerpages-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e0186cab9b841a745144e0155c37b375", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 1273594, "upload_time": "2016-10-18T11:49:31", "url": "https://files.pythonhosted.org/packages/dd/52/039e7c23d345ad12314033023ffb9a33752cafcad472aa76ba7b2992d2f3/django_powerpages-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "48de91105d56209e89482e5b1739b264", "sha256": "2409bca23d05ac7a7100ed74a72b85d263e245fc320b8c45c80cfe88a373473a" }, "downloads": -1, "filename": "django-powerpages-0.0.3.tar.gz", "has_sig": false, "md5_digest": "48de91105d56209e89482e5b1739b264", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1234145, "upload_time": "2016-10-18T11:49:36", "url": "https://files.pythonhosted.org/packages/85/05/8c85dc318073ec60c4aba28e7b8574e8aa65e2230c653353230cbf960fa9/django-powerpages-0.0.3.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "382a2f51080fd0a214e5d9c52a99b5fd", "sha256": "5e7b4d391ed1f4b551c2ac956ce3ce157e82bbe7e2de599cd5cf2fc80509a26c" }, "downloads": -1, "filename": "django_powerpages-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "382a2f51080fd0a214e5d9c52a99b5fd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 1278205, "upload_time": "2016-10-26T09:05:40", "url": "https://files.pythonhosted.org/packages/64/2c/51da0264182fe2a6065a65c11e9a1352813ed70d0a191c88d4d17da8d596/django_powerpages-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "08e08b78d779b3fbdea76e7b7c1cad11", "sha256": "f5e473f03cef3073c3d26a63c8b621ada2199e86209cd1b77cdf2f014ff7f974" }, "downloads": -1, "filename": "django-powerpages-0.0.5.tar.gz", "has_sig": false, "md5_digest": "08e08b78d779b3fbdea76e7b7c1cad11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1238166, "upload_time": "2016-10-26T09:05:46", "url": "https://files.pythonhosted.org/packages/a6/59/3faf1cac7712fbade7d525173f2bb48bd614f0a5205ae65665f170055944/django-powerpages-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "947917f3de2196591e8ffd3a99fa02af", "sha256": "f171e5547b3dbec1644b8ce4f7573d88247d095406e19a21e42b0f53fbe908fc" }, "downloads": -1, "filename": "django_powerpages-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "947917f3de2196591e8ffd3a99fa02af", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 1278663, "upload_time": "2016-10-26T10:54:30", "url": "https://files.pythonhosted.org/packages/7b/3b/415945ee8aff4096ff203ccec1acadc5b6782619eeb7fe47b7a1ef60e56d/django_powerpages-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b9c30acc737c716e41175a0babb3b419", "sha256": "43f4490f1546c2fd716f00f96df2f91bca7436dab0142d6912a143ef1e1ea2e2" }, "downloads": -1, "filename": "django-powerpages-0.0.7.tar.gz", "has_sig": false, "md5_digest": "b9c30acc737c716e41175a0babb3b419", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1229267, "upload_time": "2017-05-05T08:27:23", "url": "https://files.pythonhosted.org/packages/8c/96/1b72f71afea8c1e264e8896b26ae931adb5e7e8fc8d31262614455275785/django-powerpages-0.0.7.tar.gz" } ], "0.0.7": [], "0.0.8": [ { "comment_text": "", "digests": { "md5": "04a22af8dc9da8d1ac45c48d7ce3e464", "sha256": "920afd90bf015a041a0de96261a737da6a826a81769713b37f362350546a65bd" }, "downloads": -1, "filename": "django_powerpages-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "04a22af8dc9da8d1ac45c48d7ce3e464", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 1279672, "upload_time": "2017-05-17T10:10:29", "url": "https://files.pythonhosted.org/packages/cc/80/fc722e918bbf8a0ebc83fb42f3fb9bd9e9223c048a0ff8739820561df732/django_powerpages-0.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c29581c32b845c69b3c36173e345094", "sha256": "c607a06a069d81fcd2885d5603b2681ed744f33b36838b1982061dd7b658f7fc" }, "downloads": -1, "filename": "django-powerpages-0.0.8.tar.gz", "has_sig": false, "md5_digest": "5c29581c32b845c69b3c36173e345094", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1229308, "upload_time": "2017-05-17T10:10:33", "url": "https://files.pythonhosted.org/packages/4f/3f/5e09eaadc1e9f6d5ee8b171eb222d36262c8680e568cc6ca8b49e2cc7cb0/django-powerpages-0.0.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "04a22af8dc9da8d1ac45c48d7ce3e464", "sha256": "920afd90bf015a041a0de96261a737da6a826a81769713b37f362350546a65bd" }, "downloads": -1, "filename": "django_powerpages-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "04a22af8dc9da8d1ac45c48d7ce3e464", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 1279672, "upload_time": "2017-05-17T10:10:29", "url": "https://files.pythonhosted.org/packages/cc/80/fc722e918bbf8a0ebc83fb42f3fb9bd9e9223c048a0ff8739820561df732/django_powerpages-0.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5c29581c32b845c69b3c36173e345094", "sha256": "c607a06a069d81fcd2885d5603b2681ed744f33b36838b1982061dd7b658f7fc" }, "downloads": -1, "filename": "django-powerpages-0.0.8.tar.gz", "has_sig": false, "md5_digest": "5c29581c32b845c69b3c36173e345094", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1229308, "upload_time": "2017-05-17T10:10:33", "url": "https://files.pythonhosted.org/packages/4f/3f/5e09eaadc1e9f6d5ee8b171eb222d36262c8680e568cc6ca8b49e2cc7cb0/django-powerpages-0.0.8.tar.gz" } ] }