{ "info": { "author": "Diederik van der Boor", "author_email": "opensource@edoburu.nl", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.11", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. image:: https://img.shields.io/travis/django-fluent/django-fluent-pages/master.svg?branch=master\n :target: http://travis-ci.org/django-fluent/django-fluent-pages\n.. image:: https://img.shields.io/pypi/v/django-fluent-pages.svg\n :target: https://pypi.python.org/pypi/django-fluent-pages/\n.. image:: https://img.shields.io/pypi/l/django-fluent-pages.svg\n :target: https://pypi.python.org/pypi/django-fluent-pages/\n.. image:: https://img.shields.io/codecov/c/github/django-fluent/django-fluent-pages/master.svg\n :target: https://codecov.io/github/django-fluent/django-fluent-pages?branch=master\n\ndjango-fluent-pages\n===================\n\nThis is a stand-alone module, which provides a flexible,\nscalable CMS with custom node types, and flexible block content.\n\nFeatures:\n\n* A fully customizable page hierarchy.\n* Support for multilingual websites.\n* Support for multiple websites in a single database.\n* Fast SEO-friendly page URLs.\n* SEO optimized (meta keywords, description, title, 301-redirects, sitemaps integration).\n* Plugin support for custom page types, which:\n\n * Integrate application logic in page trees.\n * Integrate advanced block editing (via as django-fluent-contents_).\n\nFor more details, see the documentation_ at Read The Docs.\n\nPage tree customization\n-----------------------\n\nThis module provides a page tree, where each node type can be a different model.\nThis allows developers like yourself to structure your site tree as you see fit. For example:\n\n* Build a tree structure of RST pages, by defining a ``RstPage`` type.\n* Build a tree with widget-based pages, by integrating django-fluent-contents_.\n* Build a \"product page\", which exposes all products as sub nodes.\n* Build a tree of a *homepage*, *subsection*, and *article* node, each with custom fields like professional CMSes have.\n\nEach node type can have it's own custom fields, attributes and rendering.\n\nIn case you're building a custom CMS, this module might just be suited for you,\nsince it provides the tree for you, without bothering with anything else.\nThe actual page contents is defined via page type plugins.\n\n\nInstallation\n============\n\nFirst install the module, preferably in a virtual environment:\n\n.. code-block:: bash\n\n pip install django-fluent-pages\n\nAll dependencies will be automatically installed.\n\nConfiguration\n-------------\n\nYou can also use the ready-made template:\n\n.. code-block:: bash\n\n mkdir my-website.com\n cd my-website.com\n django-admin.py startproject mywebsite . -e py,rst,example,gitignore --template=https://github.com/edoburu/django-project-template/archive/django-fluent.zip\n\nOr create a new project:\n\n.. code-block:: bash\n\n cd ..\n django-admin.py startproject fluentdemo\n\nTo have a standard setup with django-fluent-contents_ integrated, use:\n\n.. code-block:: python\n\n INSTALLED_APPS += (\n # The CMS apps\n 'fluent_pages',\n\n # Required dependencies\n 'mptt',\n 'parler',\n 'polymorphic',\n 'polymorphic_tree',\n 'slug_preview',\n\n # Optional widget pages via django-fluent-contents\n 'fluent_pages.pagetypes.fluentpage',\n 'fluent_contents',\n 'fluent_contents.plugins.text',\n 'django_wysiwyg',\n\n # Optional other CMS page types\n 'fluent_pages.pagetypes.redirectnode',\n\n # enable the admin\n 'django.contrib.admin',\n )\n\n DJANGO_WYSIWYG_FLAVOR = \"yui_advanced\"\n\nNote each CMS application is optional. Only ``fluent_pages`` and ``mptt`` are required.\nThe remaining apps add additional functionality to the system.\n\nIn ``urls.py``:\n\n.. code-block:: python\n\n urlpatterns += patterns('',\n url(r'', include('fluent_pages.urls'))\n )\n\nThe database can be created afterwards:\n\n.. code-block:: bash\n\n ./manage.py migrate\n ./manage.py runserver\n\n\nCustom page types\n-----------------\n\nThe key feature of this module is the support for custom node types.\nTake a look in the existing types at ``fluent_pages.pagetypes`` to see how it's being done.\n\nIt boils down to creating a package with 2 files:\n\nThe ``models.py`` file should define the custom node type, and any fields it has:\n\n.. code-block:: python\n\n from django.db import models\n from django.utils.translation import ugettext_lazy as _\n from fluent_pages.models import HtmlPage\n from mysite.settings import RST_TEMPLATE_CHOICES\n\n\n class RstPage(HtmlPage):\n \"\"\"\n A page that renders RST code.\n \"\"\"\n rst_content = models.TextField(_(\"RST contents\"))\n template = models.CharField(_(\"Template\"), max_length=200, choices=RST_TEMPLATE_CHOICES)\n\n class Meta:\n verbose_name = _(\"RST page\")\n verbose_name_plural = _(\"RST pages\")\n\nA ``page_type_plugins.py`` file that defines the metadata, and rendering:\n\n.. code-block:: python\n\n from fluent_pages.extensions import PageTypePlugin, page_type_pool\n from .models import RstPage\n\n\n @page_type_pool.register\n class RstPagePlugin(PageTypePlugin):\n model = RstPage\n sort_priority = 10\n\n def get_render_template(self, request, rstpage, **kwargs):\n return rstpage.template\n\nA template could look like:\n\n.. code-block:: html+django\n\n {% extends \"base.html\" %}\n {% load markup %}\n\n {% block headtitle %}{{ page.title }}{% endblock %}\n\n {% block main %}\n