{ "info": { "author": "Dave Lowe", "author_email": "dave@hellopullswitch.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "django-freeplay\n===============\n\nFreeplay is a unique approach to easily add CMS functionality to\nyour Django app. Define regions for managing (and allowing clients to manage) \nbits of content on your site that don't need the full build-out of \ncustom apps. For example, that list of links in the footer, or the photo \nand bio of the CEO. With Freeplay, each region can contain one or many \nitems, so you quickly gain flexible model-like functionality.\n\nEach bit of content gets rendered onsave with Django's template \nprocessor, so you have all the power of the Django's parser.\n\n\nInstallation\n============\n\n1. ``pip install django-freeplay``\n2. Add ``'freeplay'`` and ``'relatedwidget'`` to your ``INSTALLED_APPS``\n in your project's settings.py\n3. Add ``(r\"^admin/content/\", include(\"freeplay.urls_admin\")),`` to \n your main urls.py, before you include the admin urls\n4. Sync your db or use your migration tool of choice \n (recommended: `nashvegas`_)\n\n.. _`nashvegas`: https://github.com/paltman/nashvegas\n\n\nRequirements\n============\n\nInstalling freeplay will also bring \n`django-model-utils`_, `django-imagekit`_, \nand `django-relatedadminwidget`_ with it.\n\nThe admin templates assume the existence of a few CSS and JS libraries: \n`Chosen`_, `Masonry`_, and `jQuery.Slugify`_. Place\nthe files here (in relation to your staticfiles directory) to \"just make it\nwork\":\n\n- chosen_v1.0.0/chosen.jquery.min.js\n- masonry/jquery.masonry.min.js\n- jquery-slugify/dist/slugify.min.js\n\nNote: All three of these can be installed quickly using `bower`_. Add\n`django-bower`_ to your project if you haven't yet!\n\nThese paths can also be overridden with a `FREEPLAY` setting in your settings\nfile:\n\n.. code-block:: python\n\n FREEPLAY = {\n \"CHOSEN_PATH\": \"some/path/chosen.js\",\n \"SLUGIFY_PATH\": \"some/path/slugify.js\",\n \"MASONRY_PATH\": \"some/path/masonry.js\"\n }\n\nAnd for more advanced customization, you can always override the freeplay\ntemplates with your own.\n\n.. _`django-model-utils`: https://github.com/carljm/django-model-utils\n.. _`django-imagekit`: https://github.com/jdriscoll/django-imagekit\n.. _`django-relatedadminwidget`: https://github.com/benjaoming/django-relatedadminwidget\n.. _`Chosen`: https://github.com/harvesthq/chosen/\n.. _`Masonry`: http://masonry.desandro.com\n.. _`jQuery.Slugify`: https://github.com/pmcelhaney/jQuery-Slugify-Plugin\n.. _`bower`: http://bower.io/\n.. _`django-bower`: https://github.com/nvbn/django-bower\n\nUsage\n=====\n\nIn the django admin, create a new freeplay **Template**. Start by defining the \ntemplate **bits** and then write the template **code**. For example, let's say we want to \nmanage a few FAQs. We'd create one bit like so:\n\n| Kind: Plain Text \n| Name: Question \n| Context name: question \n| Order: 1 \n| Text Widget: Textarea Input Field \n| Required: True \n\nAnd another:\n\n| Kind: Markdown \n| Name: Answer \n| Context name: answer \n| Order: 2 \n| Text Widget: Textarea Input Field \n| Required: True\n\n(Note: if you use Markdown, be sure you've added ``markdown`` to your \nrequirements)\n\nWhen you set up the bits for a template, you're defining the form that you \nor your clients will use to add and edit content for items that use this \ntemplate. As such, you can include help text with each bit.\n\nNow we can write the following for the template Code:\n\n.. code-block:: html\n\n {{ order }}\n {{ question|title }}\n