Skip to main content

django-aloha

What is django-aloha

django-aloha is a django app to easily integrate editing with Aloha WYSIWIG editor in django apps.

You just edit the blocks of text on your pages, no admin needed.

How it works

django-aloha wraps editable text fields into separate forms. See how to do it in the “Usage” section.

Installation

  1. download aloha-editor from GitHub https://github.com/alohaeditor/Aloha-Editor

    my version was commit 787859e2313337f171f32b7574cec23393fa6a77

  2. For existing JS and CSS to work (this is optional, you can create your own ones) place the aloha files into your {{MEDIA_URL}}js/aloha/, so that the “lib” directory is in {{MEDIA_URL}}js/aloha/lib/.

  3. Install django-aloha into your python:

    easy_install django-aloha
  4. Add “django-aloha” to INSTALLED_APPS in settings.py

  5. Make sure you have jquery enabled.

  6. (Optional) add existing JS and CSS to your templates, where you usually place JS and CSS:

    {% include 'aloha/includes/js.html' %}
    {% include 'aloha/includes/css.html' %}

    Or you can just copy these files into your TEMPLATES dir, and edit according to your needs.

Usage

Use in your templates like this.

  1. Option one - you want to edit a certain field on a model instance:

    {% load aloha_tags %}
    
    {% aloha my_object_from_the_database 'fieldname_where_text_is' [url_to_save] %}
       {{ my_object_from_the_database.fieldname_where_text_is|safe }}
    {% endaloha %}

    If you want, you can add an optional “url” parameter to do custom POST processing. If not provided, aloha.views.save will be used.

  2. Option two - you want to edit arbitrary text, and optionally, provide and url to save it:

    {% load aloha_tags %}
    
    {% aloha [url_to_save_to] %}
       <p>Place here what you want to edit</p>
    {% endaloha %}

The custom save URL should process POST requests, and accepts following parameters:

  • object_name

  • field_name

  • object_pk

  • content

All of these are generated by the tag, no need to worry about them.

TODO

  • Add more strict permission processing (not it just uses request.user.is_staff to check for permissions)

  • Process thourgh AJAX instead of raw POSTS (to protect data loss on errors)

Metadata

Release files for django-aloha 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-aloha 0.0.1
File Size Uploaded Provenance Actions
django-aloha-0.0.1.tar.gz 5.0 kB Without provenance Details for django-aloha-0.0.1.tar.gz

Release files / django-aloha-0.0.1.tar.gz

Download URL django-aloha-0.0.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
41ed580d2b6261e49ccdb98b2034850ddf8d75d24ddef6fd0600d15a1d4f34df
BLAKE2b-256 checksum
How to use checksums
985459f6cceb562cde71d0e3d8eb3b6bf9077e4e4578eb72ba0cb214672ed76f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-aloha 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page