Y
Y
Yuri2021-12-12 18:14:28
Django
Yuri, 2021-12-12 18:14:28

How to properly install django-markitup?

Installed django-markitup in a virtual environment.

Added 'markitup' to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'markitup',
]


Added to settings.py:

MARKITUP_FILTER = ('markdown.markdown', {'safe_mode': True})
MARKITUP_SET = 'markitup/sets/markdown'


Added to urls.py:

urlpatterns = [
    ...
    path(r'^markitup/', include('markitup.urls')),
]


Throws an error:

Reverse for 'markitup_preview' not found. 'markitup_preview' is not a valid view function or pattern name.

What else needs to be done?

The documentation has the line "Make the contents of the markitup/static/markitup directory available at STATIC_URL/markitup; the simplest way is via django.contrib.staticfiles". I don't understand how to do it.

Also found in the markitup_preview documentation:

"Note

Using the MarkItUpWidget or markitup_editor template tag will automatically set the previewParserPath in your MarkItUp! set to reverse('markitup_preview'), if markitup.urls is included in your URLconf."

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question