This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description
Flask-Edits
~~~~~~~~~~~

"Can't you just, rewrite it to sound more *edgy?*"

Clients blowing up your phone to change some copy on the ``/about``
page?

Enter **Flask-Edits**. Mark sections of your templates with
``{% editable %}`` and their content is exposed in a slick admin panel.
Never worry about tweaking copy again.

.. figure:: http://i.imgur.com/kgAlUAV.png
:alt: Screenshot

Screenshot
Installation
^^^^^^^^^^^^

::

$ pip install flask-edits

Usage
^^^^^

::

from flask.ext.edits import Edits

app = Flask(__name__)
edits = Edits(app)

All edits are saved to the disk as JSON, so configure a path to save the
edits. Edits can be commited to version control along with the rest of
the app.

::

import os.path as op
app.config['EDITS_PATH'] = op.join(op.dirname(op.abspath(__file__)), 'edits.json')

Mark sections of your Jinja templates as editable. The section name is
required, it's used as the section label when editing and the key that
the edits are stored under.

::

{% editable 'Section name' %}
Python is a programming language that lets you work quickly and integrate systems more effectively.
{% endeditable %}

**Important:**

There is no automatic detection of editable sections (yet). You have to
visit the URL that renders the template to register it as editable. It
will not show up in the admin panel until it has been rendered with
``render_template``.

Admin
^^^^^

The Flask-Edits admin view is exposed by default at ``/edits``. The base
URL can be changed in the configuration:

::

app.config['EDITS_URL'] = '/edits'

**Note on security:**

Like Flask-Admin, Flask-Edits does not make any assumptions about the
authentication system you might be using. So, by default, the admin
interface is completely open. Protect it behind basic auth or another
form of authentication.

Editing
^^^^^^^

All pages that have registered editable sections are available to edit
in the interface. At this time, only static HTML is supported. Support
for Jinja2 is on the roadmap.

The `Summernote <http://hackerwins.github.io/summernote/>`__ HTML editor
is included but not used by default. To enable it:

::

app.config['EDITS_SUMMERNOTE'] = True

When a page is saved it instantly updates the Jinja context and writes
to the JSON file on the server.

Within a page, multiple sections with the same name will only show up
once in the admin panel, but the edits will be applied to each section.

Clearing a section will revert it to the original content in the
template.

Previews
^^^^^^^^

Preview mode is on by default. Edits will not show up on pages unless
``?preview=true`` is passed in the URL. This allows for easy editing
before content is live. Toggle the preview mode in the admin panel. If
previews are turned off, edits become live as they are saved.

Preview mode can be toggled in the configuration. To turn off previews
by default:

::

app.config['EDITS_PREVIEW'] = False

Turning off previews is recommended for use in production.

Roadmap
^^^^^^^

- Automatically register editable sections
- Jinja2 content with context evaluation
- Multiple database backends
- In-place page editing
Release History

Release History

0.8

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.7

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.6

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
Flask-Edits-0.8.tar.gz (253.3 kB) Copy SHA256 Checksum SHA256 Source Aug 26, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting