Skip to main content

Allows pluggable WYSIWYG editors in django admin without hard dependencies

Project description

Django-editor

https://secure.travis-ci.org/littlepea/django-editor.png

Allows pluggable WYSIWYG editors in django admin without hard dependencies.

Currently supported editors (both optional):

Installation

  1. Install with pip:

    pip install django-editor
  2. (optional) Add imperavi or tinymce to your INSTALLED_APPS in settings.py:

    INSTALLED_APPS = (
        ...
        # Imperavi (or tinymce) rich text editor is optional
        'imperavi',
    )

Usage

editor package gives you the following replacement classes:

  • django.forms.widgets.Textarea => editor.EditorWidget (becomes ImperaviWidget or TinyMCE)

  • django.contrib.admin.ModelAdmin => editor.EditorAdmin (becomes ImperaviAdmin or stays as ModelAdmin)

  • django.contrib.admin.StackedInline => editor.EditorStackedInline (becomes ImperaviStackedInline or stays as StackedInline)

Here are some examples on how to easily turn your Textareas into WYSIWYG editors:

# admin.py
from django.db import models
from django.contrib import admin
from editor.admin import EditorAdmin, EditorWidget, EditorStackedInline


class MyInlineAdmin(EditorStackedInline): # StackedInline example
    model = Model1


class MyModel2Admin(EditorAdmin): # ModelAdmin example
    inlines = [MyInlineAdmin]

admin.site.register(Model2, MyModel2Admin)


class MyModel3Admin(admin.ModelAdmin):
    formfield_overrides = {
        models.TextField: {'widget': EditorWidget},
    }

admin.site.register(Model3, MyModel3Admin)

Credits

News

0.2a1

Release date: UNRELEASED

  • Working on more editors. Stay tuned…

0.1

Release date: 19-Mar-2013

  • Initial release

  • Supports django-imperavi and django-tinycme

  • 3 admin classes: EditorAdmin, EditorWidget, EditorStackedInline

  • Test coverage

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

django-editor-0.1.tar.gz (6.2 kB view hashes)

Uploaded Source

Supported by

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