4👍
✅
You have a typo in your HTML: from
instead of form
.
You may realize this, but that code won’t really save anything. I’m not sure what blog you are following, but you would be better-off following the official Django tutorial in the documentation, then reading the forms docs.
1👍
You may need to change method
to "POST"
in your form.
<from method = "get" action="/wikicamp/{{page_name}}/save/">
to
<form method = "post" action="/wikicamp/{{page_name}}/save/">
- [Django]-Django-rest returning http 301 status code when calling http delete without trailing slash
- [Django]-Django: Override get_Form inlines
- [Django]-How can I create an inherited django model instance from an existing base model instance?
0👍
There are some spelling mistakes, such as from
instead of form
.
Also the form is malformed.
Change:
<a href="/wikicamp/{{page_name}}/save/">this is link to save</a>
to
<input type="submit" value="Save Page" />
And thirdly, change the method= "get"
to method="POST"
.
The entire form should look like this
<form method = "POST" action="/wikicamp/{{page_name}}/save/">
{% csrf_token %}
<textarea name = "content" rows="20" cols="60">
{{content}}
</textarea>
<br/>
<input type="submit" value="Save Page"/>
</form>
Also what @DanielRoseman said. But hey, it might come further down the road.
- [Django]-How to set a default TZ for django admin portal only?
- [Django]-Complex django query including one-to-one models
- [Django]-Wagtail admin ,CheckboxSelectMultiple not saving data
- [Django]-UWSGI resets worker on lifetime reached causes downtime
- [Django]-How to use updateview with a ForeignKey/OneToOneField
Source:stackexchange.com