Skip to main content
Django Imperavi editor
======================
Supported versions
------------
Supports Django >=1.8 and Python 2/3

Installation
------------
```
pip install git+https://github.com/dzaytsev91/django-imperavi-widget.git
```

* Add ``imperavi`` to your ``INSTALLED_APPS`` setting.

* Add imperavi URL include to your project's ``urls.py`` file::

```
url(r'^imperavi/', include('imperavi.urls')),
```

Example
-----
```
cd example/
python manage.py migrate
./manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'admin@example.com', 'admin')"
python manage.py runserver
```
Then go to [http://127.0.0.1:8000/admin/](127.0.0.1:8000/admin/) and try to create post instance

login: admin
password: admin


Usage
-----

The quickest way to add rich text editing capabilities to your admin is to use the included ``ImperaviAdmin`` class. For example::

from .models import Category
from imperavi.admin import ImperaviAdmin

class CategotyAdmin(ImperaviAdmin):
pass

admin.site.register(Category, CategotyAdmin)

If you want to use it with inline admin models you need to use ``ImperaviStackedInlineAdmin`` class::

from .models import Post
from imperavi.admin import ImperaviStackedInlineAdmin

class PostInline(ImperaviStackedInlineAdmin):
model = Post
extra = 1

Custom settings
---------------

Add a ``IMPERAVI_CUSTOM_SETTINGS`` variable to your ``settings.py`` with custom config::

IMPERAVI_CUSTOM_SETTINGS = {
'resize': true
}

Full list of settings is here.
[http://redactorjs.com/docs/settings/](ttp://redactorjs.com/docs/settings/)

Media URL
---------

You can also customize the URL that django-imperavi-widget will look for the Editor media at by adding ``IMPERAVI_UPLOAD_PATH`` to your ``settings.py`` file like this::

IMPERAVI_UPLOAD_PATH = 'imperavi-uploads/'

The default value is ``'imperavi/'``.


Unique images per model
-----------------------

If you want to serve unique media content for specific model you can add ``unique_media = True`` to your admin class::

from .models import Category
from imperavi.admin import ImperaviAdmin

class CategotyAdmin(ImperaviAdmin):
unique_media = True

admin.site.register(Category, CategotyAdmin)

Metadata

Release files for django-imperavi-widget 0.0.3

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-imperavi-widget 0.0.3
File Size Uploaded
django-imperavi-widget-0.0.3.tar.gz 159.0 kB Details

Release files / django-imperavi-widget-0.0.3.tar.gz

Download URL django-imperavi-widget-0.0.3.tar.gz
Size 159.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f5d645cf08714d53801a3fd016e408054de144472eff000b65f7a07a0a560f2c
BLAKE2b-256 checksum
How to use checksums
c093f937fbd48b9b89177bc8870490dfd07408d8b20ccc2788c0453c2dd9d33e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file

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