
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
docutils (a.k.a. reStructuredText / rst / reST) support for Django.
Install django-docutils:
$ pip install django-docutils
Next, add django_docutils
to your INSTALLED_APPS
in your settings file:
INSTALLED_APPS = [
# ... your default apps,
'django_docutils'
]
In your template:
{% load django_docutils %}
{% rst %}
# hey
# how's it going
A. hows
B. it
C. going
D. today
**hi**
*hi*
{% endrst %}
In your template:
{% load django_docutils %}
{% filter rst %}
# hey
# how's it going
A. hows
B. it
C. going
D. today
**hi**
*hi*
{% endfilter %}
You can also use a class-based view to render reStructuredText (reST).
If you want to use reStructuredText as a django template engine, INSTALLED_APPS
isn't required,
instead you add this to your TEMPLATES
variable in your settings:
TEMPLATES = [
# ... Other engines
{
"NAME": "docutils",
"BACKEND": "django_docutils.template.DocutilsTemplates",
"DIRS": [],
"APP_DIRS": True,
}
]
Now django will be able to scan for .rst files and process them. In your view:
from django_docutils.views import DocutilsView
class HomeView(DocutilsView):
template_name = 'base.html'
rst_name = 'home.rst'
# Optional, automatically maps roles, directives and transformers
DJANGO_DOCUTILS_LIB_RST = {
"docutils": {
"raw_enabled": True,
"strip_comments": True,
"initial_header_level": 2,
},
"roles": {
"local": {
"gh": "django_docutils.lib.roles.github.github_role",
"twitter": "django_docutils.lib.roles.twitter.twitter_role",
"email": "django_docutils.lib.roles.email.email_role",
}
},
"directives": {
"code-block": "django_docutils.lib.directives.code.CodeBlock",
}
}
# Optional
DJANGO_DOCUTILS_LIB_TEXT = {
"uncapitalized_word_filters": ["project.my_module.my_capitalization_fn"]
}
FAQs
Docutils (a.k.a. reStructuredText, reST, RST) support for django.
We found that django-docutils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.