问题
I have a TextField
for description on one of my forms, and i want to apply reich text editor for that so tried to use this package, but i am unable to make it work
below are my settings
settings.py
INSTALLED_APPS = (
.....
.....
# Description Rich text editor settings
'tinymce',
'django_wysiwyg',
)
DJANGO_WYSIWYG_FLAVOR = "tinymce"
template.html
{% extends "base.html" %}
{% load wysiwyg %}
{% wysiwyg_setup %}
<form enctype="multipart/form-data" action="{% url 'product_create' %}" method="post">
<div class="marg_tp38 span12">
{{product_form.name}}
{% wysiwyg_editor 'id_name' %}
</div>
<div class="marg_tp38 span12">
{{product_form.description}}
{% wysiwyg_editor 'inputdescription_id' %}
</div>
</form>
So above are my settings that i have used, but i could n't able to make that work, can anyone please let me know what am i missing ? and what should be done in order to make it work ?
回答1:
Move {% wysiwyg_setup %} in head section
Make sure you have copied tinymce in static folder, and set correct path for DJANGO_WYSIWYG_MEDIA_URL in settings as mentioned on documentation.
来源:https://stackoverflow.com/questions/20097929/make-django-wysiwyg-work-on-django-pages