Skip to content

Commit 6bbb58b

Browse files
authored
Merge pull request #23 from hengage/hengage-patch-1
Update README.md with form rendering instructions
2 parents 08ec52a + 2fd540d commit 6bbb58b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ Similarly here you can display the article's body by marking it as `safe`
8383
<div class="article-body">{{ article.body.content | safe}}</div>
8484
```
8585

86+
### Forms with rich-text editing
87+
88+
You can create forms for your Django Prose models, to provide rich-text editing functionality. In that case, you will also need to render `form.media`, to load Trix with its stylesheets.
89+
90+
```django
91+
<form method="POST" >
92+
{% csrf_token %}
93+
94+
{{ form.as_p }}
95+
{{ form.media }}
96+
97+
<button type="submit">Submit</button>
98+
</form>
99+
```
100+
101+
The same is true also, if you are rendering the forms field manually.
102+
86103
### Attachments
87104

88105
Django Prose can also handle uploading attachments with drag and drop. To set this up, first you need to:

0 commit comments

Comments
 (0)