{"repo":"dmptrluke/django-markdownfield","free":true,"listed":false,"github":"https://github.com/dmptrluke/django-markdownfield","clone":"git clone https://github.com/dmptrluke/django-markdownfield.git","description":"A custom field for Django that can safely render Markdown and store it in the database.","language":"Python","stars":48,"topics":["django","markdown","python"],"license":"MIT","category":"databases-storage","readme_excerpt":"django-markdownfield A Django field that renders Markdown to sanitized HTML and stores both in your database. Your text is stored in a MarkdownField . When the model is saved, django-markdownfield renders it with markdown-it-py (by default), sanitizes it with nh3, and stores the result in a RenderedMarkdownField . The rendering backend is swappable. Bundles EasyMDE (v2.20.0) for admin and frontend forms. Installation Add to INSTALLED APPS and configure the rendering backend: Backend configuration (plugins, HTML passthrough, custom backends) is covered in docs/backends.md. A python-markdown backend is also included ( pip install django-markdownfield[pymarkdown] ). To enable the admin preview endpoint, add the URL configuration: Quick start Add a MarkdownField and a paired RenderedMarkdownField to your model: Whenever your model is saved, the RenderedMarkdownField will be updated automatically. Display in templates To display the rendered markdown in your template, just display the RenderedMarkdownField like any other field. If you don't want to use a RenderedMarkdownField , use the template filter to render raw Markdown in your templates directly: The argument is a validator name. Defaults to standard . Render in Python Validators Validators control which HTML tags and attributes survive sanitization, and which toolbar buttons appear in the editor. Validator Tags Use case --- --- --- VALIDATOR STANDARD All standard Markdown tags General content VALIDATOR CLASSY Standard + clas","default_branch":null,"files":null,"tree":[],"storefront":"/r/dmptrluke","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/dmptrluke/django-markdownfield/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}