Wondering which restructured package most of you use in django 1.5+?
from django.contrib.markup.templatetags.markup import restructuredtext
Returns:
ImportError ...
No module named markup.templatetags.markup
https://docs.djangoproject.com/en/1.6/releases/1.5-alpha-1/#django-utils-markup
Yes the django.utils.markup
was deprecated in 1.5 and removed in 1.6. The Python implementation of the reStructuredText markup lives in the docutils package. That is the implementation that Django <= 1.5 used.
The easiest way to install docutils is using pip:
pip install docutils
You can find the old django.utils.markup
implementation in the 1.5.x branch on Djangos github repo:
https://github.com/django/django/blob/stable/1.5.x/django/contrib/markup/templatetags/markup.py#L76
This is an addon to the answer by @jbub:
When you have an old Django application and you want to continue using markup, follow these steps:
django.contrib.markup
from INSTALLED_APPS
(in the file settings.py
templatetags
to your applicationmarkup.py
from https://github.com/django/django/blob/stable/1.5.x/django/contrib/markup/templatetags/markup.py#L76 to templatetags
__init__.py
in the templatetags
directoyNote that this procedure keeps your old application working. However, the deprecation of django.contrib.markup
came for a reason: There were security concerns over possible cross-site scripting attacks using markdown. You are on your own to deal with this problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With