A custom form widget of Django for markdown
Project description
## Django MKEditor
A form widget that change the textfield style to the markdown.
![](mk.png)
## Installation
1. Get the code: `pip install mkeditor`
2. Add `mkedirot` to your `INSTALLED_APPS`
## Usage
1. In forms.py
```
from mkeditor.widgets import MarkdownWidget
class ArticleForm(forms.ModelForm):
class Meta:
widgets = {
'content': MarkdownWidget, # the content is model field
}
```
2. In admin.py
```
from .form import ArticleForm
class ArticleAdmin(admin.ModelAdmin):
form = ArticleForm
admin.site.register(Article, ArticleAdmin)
```
A form widget that change the textfield style to the markdown.
![](mk.png)
## Installation
1. Get the code: `pip install mkeditor`
2. Add `mkedirot` to your `INSTALLED_APPS`
## Usage
1. In forms.py
```
from mkeditor.widgets import MarkdownWidget
class ArticleForm(forms.ModelForm):
class Meta:
widgets = {
'content': MarkdownWidget, # the content is model field
}
```
2. In admin.py
```
from .form import ArticleForm
class ArticleAdmin(admin.ModelAdmin):
form = ArticleForm
admin.site.register(Article, ArticleAdmin)
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mkeditor-0.1.tar.gz
(1.3 MB
view details)
File details
Details for the file mkeditor-0.1.tar.gz
.
File metadata
- Download URL: mkeditor-0.1.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2f0b742911326d17b8c453daf15a7c6a5436c4f42ad9496ffff5ad20edf1a66 |
|
MD5 | 7b0f75a34316d084bbb6962e2e74769a |
|
BLAKE2b-256 | e6261f6000d32801ed6f5593c743644d0daf9b245163c97b9bfe0b13060c719c |