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!

Medium Editor widget for Django

Project Description
# Django Medium Editor
Adds [Medium Editor](https://yabwe.github.io/medium-editor/) to [Django](https://www.djangoproject.com/).

## Supported Environments

* Django 1.9
* Python 3.4

## Installation

1. Install **django-mediumeditor**

via PyPi:
```
pip install django-mediumeditor
```
via GIT:

```
pip install git+https://github.com/g3rd/django-mediumeditor.git
```

2. Install app
```
INSTALLED_APPS = [
...
'mediumeditor',
]
```

## Usage

### Django Admin

Add to Admin class

```
from mediumeditor.admin import MediumEditorAdmin

@admin.register(MyModel)
class MyModelAdmin(MediumEditorAdmin, admin.ModelAdmin):
...
mediumeditor_fields = ('my_text_field', )
...
```

### Forms

**NOTE:** This is untested

1. Override the Widget for the field

```
from mediumeditor.widgets import MediumEditorTextarea

class MyForm(forms.ModelForm):
...
class Meta:
model = MyModel
widgets = {
'my_text_field': MediumEditorTextarea(),
}
```

2. In the ```<head>``` of the template
```
{{ form.media }}
```

### Settings
Optionaly change theme or change medium editor options in your settings.py
```
# Theme options `default`, `roman`, `mani`, `flat`, `bootstrap`, `tim`, `beagle`
MEDIUM_EDITOR_THEME = 'beagle' # `default` is defualt theme
MEDIUM_EDITOR_OPTIONS = {..}
```
[Available Options](https://github.com/yabwe/medium-editor/blob/master/OPTIONS.md)

Example:
```
MEDIUM_EDITOR_THEME = 'bootstrap'
MEDIUM_EDITOR_OPTIONS = {
'toolbar': {
'static': True,
'buttons': [
'bold',
'italic',
'underline',
'strikethrough',
'subscript',
'superscript',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
]
},
'paste': {
'forcePlainText': True,
'cleanPastedHTML': False,
'cleanReplacements': [],
'cleanAttrs': ['class', 'style', 'dir'],
'cleanTags': ['meta']
}
}
```

## Contributing

[Take out some bugs](https://github.com/g3rd/django-mediumeditor/issues)

[Report issues or feature requests](https://github.com/g3rd/django-mediumeditor/issues)


## License
MIT: https://github.com/g3rd/django-mediumeditor/blob/master/LICENSE


Release History

Release History

This version
History Node

0.2.0

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1

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
django_mediumeditor-0.2.0-py2.py3-none-any.whl (7.9 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Jan 5, 2017

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