Skip to content

ashiazed/django-fancypages

 
 

Repository files navigation

Fancy CMS-style page editing for Django

https://travis-ci.org/tangentlabs/django-fancypages.png?branch=master https://coveralls.io/repos/tangentlabs/django-fancypages/badge.png?branch=master

https://d2weczhvl823v0.cloudfront.net/tangentlabs/django-fancypages/trend.png

Fancypages provides easy inline page editing.

Another content management system, you ask? No it is not! Rather, it is a content enhancement system (CEnS) because it provides a user with the controlled ability to edit content on a page.

The way this Django app works is inspired by django-frontend-admin, django-content-blocks and other similar apps. Especially, the use of template tags to define customisable sections in a Django template is based on the ideas in the two apps mentioned above.

Screenshots

https://raw.github.com/tangentlabs/django-fancypages/master/docs/source/images/screenshots/homepage_editor_hidden.png

https://raw.github.com/tangentlabs/django-fancypages/master/docs/source/images/screenshots/homepage_editor_opened.png

https://raw.github.com/tangentlabs/django-fancypages/master/docs/source/images/screenshots/homepage_edit_block_form.png

https://raw.github.com/tangentlabs/django-fancypages/master/docs/source/images/screenshots/homepage_block_menu.png

Installation

To use django-fancypages in your own project follow these steps:

  1. Install via pip into you virtualenv (for now you have to install from the github repo because we haven't released it to PyPI yet):

    $ pip install git+https://github.com/tangentlabs/django-fancypages.git
    
  2. Add the required apps to your INSTALLED_APPS by simply using the convenience function get_apps in the fancypages module:

    from fancyages import get_required_apps, get_fancypages_apps
    
    YOUR_OTHER_APPS = [
        ...
    ]
    INSTALLED_APPS = YOUR_OTHER_APPS + get_required_apps() + get_fancypages_apps()
    
  3. Add the editor middleware that provides the editing panel to every fancypage or page that contains an FP container:

    MIDDLEWARE_CLASSES = (
        ...
        'fancypages.middleware.EditorMiddleware',
    )
    
  4. Add the urls for django-fancypages to your project's main urls.py. Make sure that it is at the end of you definitions otherwise the it will prevent your other URLs from working because it defines a rather generic URL pattern for its pages:

    urlpatterns = patterns('',
        ...
        url(r'^', include(fancypages.urls)),
    )
    
  5. Fancypages requires several default settings to be added. To make sure that you have all the default settings in your settings, you can use the defaults provided by fancypages itself. Add the following in your settings file before you overwrite specific settings:

    ...
    
    from fancypages.defaults import *
    
    ...
    

CSS

The CSS used by fancypages is generated by less using django-compressor. This means you have to have lessc installed on your system or in your virtualenv. You can either take care of that yourself or use the requirements_less.txt file with pip to install both into your virtualenv:

$ pip install -r requirements_less.txt

That's been a bit of work, hasn't it? Well done! Your should now be able to access the fancypages dashboard after staring the Django server by running ./manage.py runserver or whatever else you do for that. A very basic dashboard should now be available at: http://localhost:8000/dashboard/fancypages

Projects Using Fancypages

License

django-fancypages is released under the permissive New BSD license.