{ "info": { "author": "Praekelt Consulting", "author_email": "dev@praekelt.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "Django Composer\n===============\n**Build Pages by composing listings and individual content**\n\n.. image:: https://travis-ci.org/praekelt/django-composer-prk.svg?branch=develop\n :target: https://travis-ci.org/praekelt/django-composer-prk\n\n.. image:: https://coveralls.io/repos/github/praekelt/django-composer-prk/badge.svg?branch=develop\n :target: https://coveralls.io/github/praekelt/django-composer-prk?branch=develop\n\n.. contents:: Contents\n :depth: 5\n\nQuick start\n-----------\n\n``django-composer-prk`` is intended to be a standalone library, not a project, but it can indeed be run with::\n\n - virtualenv ve\n - ./ve/bin/pip install -r composer/tests/requirements/19.txt\n - ./ve/bin/python manage.py migrate --run-syncdb --settings=composer.tests.settings.19\n - ./ve/bin/python manage.py runserver 0.0.0.0:8000 --settings=composer.tests.settings.19\n\n\nInstallation\n------------\n\n#. Install the contents of ``composer/tests/requirements/19.txt`` to your Python environment.\n\n#. Add ``composer`` to the ``INSTALLED_APPS`` setting.\n\n#. Add ``composer.middleware.ComposerFallbackMiddleware`` to the middleware setting. This will **REPLACE** the flatpages 404 middleware, so remove that if needed.\n\n#. Add ``composer.context_processors.slots`` to the context processors setting.\n\n#. Add the following to your urls.py\n\n::\n\n url(r\"^nested_admin/\", include(\"nested_admin.urls\"))\n\nContent types\n-------------\n\nSlot:\n\n* url: The URL or URL pattern where the slot should appear. This may be a regular expression.\n\n* slot_name: In your project, the slot names are defined in ``templates/base.html``. This field provides options that are automatically generated from the composer slots found in that base template.\n\nRow:\n\n* Each row is nested within a slot (ordered).\n\n* The row can have extra CSS classes.\n\nColumn:\n\n* Each column is nested within a row (ordered).\n\n* width: A row is 12 columns wide, so columns can be fitted next to each other.\n\n* title: rendered at the top of a column. Can be blank.\n\n* class_name: Extra CSS classes that can be added to the column wrapping div.\n\nTile:\n\n* Each tile is nested within a column (ordered).\n\n* The tile target is a generic foreign key, so it can reference any content type.\n\n* The view name can be any Django named view.\n\n* Markdown is ad-hoc content. The admin UI for markdown is currently not optimal and requires a visit to the ``Tiles`` list.\n\n* style: The style is used to look up a suitable template for rendering the target. An example is ``templates/myapp/inclusion_tags/mymodel_tile.html``.\n\n* class_name: The extra CSS classes to add to the tile.\n\nUsage\n-----\n\nThe base template usually defines some composer slots. Typically this would be\na header slot, content slot and footer slot. This can be extended easily by\nadding slots to the ``templates/base.html`` template. Example of adding a\nsidebar slot: ::\n\n {% if composer_slots %}{% load composer_tags %}{% endif %}\n\n {% if composer_slots.sidebar %}\n
\n {% composer sidebar %}\n
\n {% endif %}\n\nOn any URL on the site, if an appropriate slot exists that matches the URL and slot name, that slot will be rendered on the page. The current matching logic works as follows:\n\n#. Find the slot with the best possible match for the current URL. Slot URL's are treated as regular expressions so one slot can match many URL's.\n\nThe content slot is special:\n\n#. If the template being rendered fills the content block then it trumps any slot that may try to fill the content block.\n\nSettings\n--------\n\nYou need to define the types of tiles available to the system in settings. The\n``tile`` style is added implicitly. See the tile rendering section on how to\ncreate the corresponding templates: ::\n\n COMPOSER = {\"styles\": ((\"block\", \"Block\"), (\"tiny\": \"Tiny\"))}\n\nIf you would like the styles to be inferred from all the installed apps add: ::\n\n COMPOSER = {\"load-existing-styles\": {\"greedy\": True}}\n\nIt will attempt to add all styles that are already tied to apps and models that follow the correct naming convention.\nCan be used in tandem with the ``styles`` setting.\n\nAlternatively entire apps and specific app models can be excluded or included.\n\nIncluding: ::\n\n COMPOSER = {\"load-existing-styles\": {\"includes\": {\"\": [\"\",]}}}\n COMPOSER = {\"load-existing-styles\": {\"includes\": {\"\": \"__all__\"}}}\n\nExcluding: ::\n\n COMPOSER = {\"load-existing-styles\": {\"excludes\": {\"\": [\"\",]}}}\n COMPOSER = {\"load-existing-styles\": {\"excludes\": {\"\": \"__all__\"}}}\n\n\nAd-hoc pages\n------------\n\n``django-composer-prk`` offers functionality similar to Django Flatpages. If any request leads to a Page Not Found error then\nthe middleware attempts to render up a with name ``content`` and a matching URL. This is particularly useful for creating\nso-called campaign pages.\n\nTile rendering\n----------------\n\nComposer tries to render in order: view name, target, markdown.\n\nView name\n*********\n\nRenders the view and attempts to extract anything in ``
``. The\nresult is then printed by ``templates/composer/tile.html``. Variables ``tile``\nand ``content`` are available in the template context.\n\nTarget\n******\n\nTraverses upwards through an inheritance hierarchy until the best matched\ntemplate is found. Variables ``tile``, ``object`` (the target) and ``content``\nare available in the template context.\n\nNaming convention:\n\n* ``templates/{{ app_label }}/inclusion_tags/{{ model_name }}_{{ tile_style }}.html``\n\n* ``templates/{{ app_label }}/inclusion_tags/{{ tile_style }}.html``\n\nIf no template is found then renders the view returned by\n``target.get_absolute_url()`` if it exists. It attempts to extract anything in\n``
``. The result is then printed by\n``templates/composer/tile.html``. Variables ``tile`` and ``content`` are\navailable in the template context.\n\nMarkdown\n********\n\nThe markdown is converted to HTML and then printed by\n``templates/composer/tile.html``. Variables ``tile`` and ``content`` are\navailable in the template context.\n\nAuthors\n=======\n\nPraekelt Consulting\n-------------------\n* Johan Beyers\n* Hedley Roos\n* Altus Barry\n* Cilliers Blignaut\n\nChangelog\n=========\n\n0.1.1\n-----\n#. Handle `options` request method.\n\n0.1\n---\n#. First release.\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/praekelt/django-composer-prk", "keywords": "", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "django-composer-prk", "package_url": "https://pypi.org/project/django-composer-prk/", "platform": "", "project_url": "https://pypi.org/project/django-composer-prk/", "project_urls": { "Homepage": "https://github.com/praekelt/django-composer-prk" }, "release_url": "https://pypi.org/project/django-composer-prk/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Page composer for Django", "version": "0.1.1" }, "last_serial": 3277397, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2a2e03c0d665efdcee0e3a01c0e1e419", "sha256": "2e138c2452bfdda4e558b61d6bf133e2d60f3e029df2a18ed4eba861144c2869" }, "downloads": -1, "filename": "django_composer_prk-0.1-py2.7.egg", "has_sig": false, "md5_digest": "2a2e03c0d665efdcee0e3a01c0e1e419", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 56290, "upload_time": "2017-07-05T15:14:35", "url": "https://files.pythonhosted.org/packages/88/6e/33484ec4188e7cd6c2df7a6181ea6325aec607a17bef8368533f5e5c838a/django_composer_prk-0.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "531b7fded4090d2c4f998da5e9e65d2e", "sha256": "ccc2be56d29b443766550a3203a7671d31b57d4d47f2b923779d127b8e6a5d80" }, "downloads": -1, "filename": "django-composer-prk-0.1.tar.gz", "has_sig": false, "md5_digest": "531b7fded4090d2c4f998da5e9e65d2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19551, "upload_time": "2017-07-05T15:14:31", "url": "https://files.pythonhosted.org/packages/6d/2a/85661a64921b3b4d3d5a80633e97d1a9f842caa86a55c9d0fb1366a397a9/django-composer-prk-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5e9d03273e74f7525ab0838983aab8d0", "sha256": "2d90c8804c0021e2e4b33d53ef230c6964e23b70fe264ea3938a8c20bd01f9b2" }, "downloads": -1, "filename": "django_composer_prk-0.1.1-py2.7.egg", "has_sig": false, "md5_digest": "5e9d03273e74f7525ab0838983aab8d0", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 57284, "upload_time": "2017-10-25T09:34:31", "url": "https://files.pythonhosted.org/packages/8c/fc/3aff93525c5f357c1e903d46308e6fe5956d2610cdcef04d9c405e1c12f7/django_composer_prk-0.1.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "8be4bacbd35cece1a00d356f18c555f2", "sha256": "d03bdf4f5ef0a4cbd67a37734157a23f70d5a1c8290dc6518f076b0d62184e71" }, "downloads": -1, "filename": "django-composer-prk-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8be4bacbd35cece1a00d356f18c555f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22740, "upload_time": "2017-10-25T09:34:28", "url": "https://files.pythonhosted.org/packages/e4/23/ff6eb000fc29f8efa5008983f3bc229c4fc009db2876218b8c10e0ea043d/django-composer-prk-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5e9d03273e74f7525ab0838983aab8d0", "sha256": "2d90c8804c0021e2e4b33d53ef230c6964e23b70fe264ea3938a8c20bd01f9b2" }, "downloads": -1, "filename": "django_composer_prk-0.1.1-py2.7.egg", "has_sig": false, "md5_digest": "5e9d03273e74f7525ab0838983aab8d0", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 57284, "upload_time": "2017-10-25T09:34:31", "url": "https://files.pythonhosted.org/packages/8c/fc/3aff93525c5f357c1e903d46308e6fe5956d2610cdcef04d9c405e1c12f7/django_composer_prk-0.1.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "8be4bacbd35cece1a00d356f18c555f2", "sha256": "d03bdf4f5ef0a4cbd67a37734157a23f70d5a1c8290dc6518f076b0d62184e71" }, "downloads": -1, "filename": "django-composer-prk-0.1.1.tar.gz", "has_sig": false, "md5_digest": "8be4bacbd35cece1a00d356f18c555f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22740, "upload_time": "2017-10-25T09:34:28", "url": "https://files.pythonhosted.org/packages/e4/23/ff6eb000fc29f8efa5008983f3bc229c4fc009db2876218b8c10e0ea043d/django-composer-prk-0.1.1.tar.gz" } ] }