how to get POST data in django 1.3

后端 未结 4 981
感情败类
感情败类 2021-02-06 02:49

Hey, I am following this tutorial to learn to make a wiki page with Django. However, it is made in django 0.96 and I use Django 1.3 so there are some things that are different.

4条回答
  •  轮回少年
    2021-02-06 03:43

    re above use "request.POST" not "c.POST" in the 3rd line

    def save_page (request,page_name):
        content = request.POST["content"]
    

    and change in "edit_page"

    -   return render_to_response("edit.html",{"page_name":page_name, "content":content})
    +   t = get_template('edit.html')
    +   html = t.render(Context({"page_name":page_name, "content":content}))
    +   return HttpResponse(html)
    

    - :remove 
    + :add
    

提交回复
热议问题