Skip to main content

This package allows you to store and render Markdown content effortlessly, making it ideal for applications that require rich text input from users.

Project description

Django Markdown Model

Django Markdown Model is a Python project that provides a simple way to integrate a Markdown field into your Django models. This package allows you to store and render Markdown content effortlessly, making it ideal for applications that require rich text input from users.

Features

  • MarkdownField: Easily store and manage Markdown content in your Django models.
  • Simple Integration: Quick setup and integration into existing Django projects.
  • Flexible Rendering: Supports various Markdown renderers for displaying content.

Installation

You can install this package via pip:

pip install django-markdown-model

Usage

To use this package in your Django project, follow these steps:

  1. Add django_markdown_model to your INSTALLED_APPS in your Django settings:
INSTALLED_APPS = [
...
'django_markdown_model',
]
  1. Create your models using MarkdownField:
from django.db import models
from django_markdown_model.fields import MarkdownField

class MyModel(models.Model):
title = models.CharField(max_length=200)
content = MarkdownField()

       def __str__(self):
           return self.title
  1. Use Abstract Model MarkdownModel:
from django.db import models
from django_markdown_model.fields import MarkdownField

class MyModel(MarkdownModel):
pass
  1. Render Markdown in your templates:

    Use a Markdown renderer (like markdown2 or mistune) to display the content:

<h1>{{ my_model.title }}</h1>
<div>{{ my_model.content|safe }}</div>

Example

See the examples/ directory for a complete example of how to use this package in a Django project.

Running Tests

Tests are under development.

Contributing

Contributions are welcome! Please submit a pull request or open an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-markdown-model-1.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

django_markdown_model-1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file django-markdown-model-1.0.tar.gz.

File metadata

  • Download URL: django-markdown-model-1.0.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.10

File hashes

Hashes for django-markdown-model-1.0.tar.gz
Algorithm Hash digest
SHA256 984b81552d0b23ee8ec00eeea8707ac2ba9ceec60858ac75cd1cea382962078e
MD5 ebd14f450bbbb1e9eaa92ec91bac6807
BLAKE2b-256 f8a09c6e3e2fd5e4e3c2630db721fd85e2fdef8db3cf9f881d15cc4af23853c9

See more details on using hashes here.

File details

Details for the file django_markdown_model-1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_markdown_model-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43e27c3b0a2723ad0a8df49a7e94164cfd1109bef8a9a3cc6b4e819e8d75e55a
MD5 8186ceb8fb929bdfe0cc9ccd8d48be3f
BLAKE2b-256 e506ce762faf11e4e3b5ac6c74f6a713213d5253c0857fbe0363dc2c6eb0b792

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page