Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WMD in Django Admin?

Tags:

django

admin

wmd

I know how to use WMD and other such javascript editors in regular django forms using widget=. However, how do I use WMD for text fields in the Django admin? On top of that, how do I use it for the content field on contrib.flatpages in the admin?

Also, I think I might like to use the StackOverflow fork of WMD, so I would like any special instructions for that, if necessary.

I know how to use the markdown filter in the templates, so that part is ok. I just need to get the editor to show up and work in the admin interface.

like image 404
Apreche Avatar asked Aug 11 '09 02:08

Apreche


2 Answers

I gave up on trying to use WMD. Instead, I used Markitup! As of the time of this posting, the current version of WMD is just not up to snuff. The StackOverflow fork of it is better, but is missing many features I want.

Instead, I decided to use Markitup! It has a Django reusable app. It also integrates very well with the existing django.contrib.markup template filters.

django-markitup

I also found a site that shows how to use it for flatpages without having to edit the admin templates.

extending admin forms in django

like image 75
Apreche Avatar answered Jan 01 '23 20:01

Apreche


To insert WMD, or any other cool JS, into the Django Admin pages, follow the instructions on overriding the admin templates in the Django docs, right here -- worst case, you'll copy and edit the existing Django templates to add your required JS functionality, and use those instructions to make sure your modified templates are used instead of Django's default ones, but almost always you can do better than this, as you'll see in those instructions.

like image 27
Alex Martelli Avatar answered Jan 01 '23 20:01

Alex Martelli