Skip to main content

A Django application to allow front-end editing

Project description

Django-front is a front-end editing application.

Installation

  • pip install django-front

  • Add front to your INSTALLED_APPS

  • Add a line to urlconf:

    urlpatterns += patterns('',
        url(r'^front-edit/', include('front.urls')),
    )
  • python manage.py migrate (or syncdb if that’s your dope)

Usage

In your main template:

{% load front_tags %}

Then include jQuery, followed by front-editing scripts e.g.:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
{% front_edit_scripts %}

or, if you would like to use the ACE editor:

{% front_edit_scripts editor="ace" %}

In any template:

{% load front_tags %}

...

{% front_edit "placeholder_name" request.path request.LANGUAGE_CODE %}
    <p>Default when empty</p>
{% end_front_edit  %}

Any variable passed after the name will be evaluauted. The full identifier (i.e. name and variables) will be hashed and will define the main identifier for this placeholder.

So the content block in the above example will be rendered only at the page at this URL and the current language.

This would be rendered on every page including this tag, in every language:

{% front_edit "look ma, no hands" %}
    <p>Default when empty</p>
{% end_front_edit  %}

Settings

You can define these in your settings:

  • DJANGO_FRONT_PERMISSION: a callable that gets passed a user object, and returns a Boolean specifying whether or not the user can do front-end editing. Defaults to lambda u: u and u.is_staff

Performance

The content of each block is both persisted in the database and cached via Django’s cache framework (the obviously hit first)

Requirements

  • Django 1.4+

  • django-classy-tags

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

django-front-0.1.1.zip (10.3 kB view details)

Uploaded Source

django-front-0.1.1.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file django-front-0.1.1.zip.

File metadata

  • Download URL: django-front-0.1.1.zip
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-front-0.1.1.zip
Algorithm Hash digest
SHA256 a9a592f2b9e570f67e381c3753af6cb6b9225d7539a400259dfba8497f1a8b3c
MD5 2aa0985552efee80b8e4c7214c96e9c0
BLAKE2b-256 87d5d2b2ea6537ab045b237877e560b9dacc174cc7e0004e430a099e1efa5539

See more details on using hashes here.

File details

Details for the file django-front-0.1.1.tar.gz.

File metadata

  • Download URL: django-front-0.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-front-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d5a709a98a855c9433b2b52375a7deceb83c03e7ad3b05983a7cb3e96579083c
MD5 1cc4cca42dc5901db997d92829a2f36e
BLAKE2b-256 bf196d57f9eeb9dd4b5922fd83491a7a9c987d06f9758b6adadc35e65f841070

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page