CSRF verification failed. Request aborted

后端 未结 10 1937
执笔经年
执笔经年 2020-12-01 13:04

I try to build a very simple website where one can add data into sqlite3 database. I have a POST form with two text input.

index.html:

{% if top_list         


        
10条回答
  •  独厮守ぢ
    2020-12-01 13:20

    A common mistake here is using render_to_response (this is commonly used in older tutorials), which doesn't automatically include RequestContext. Render does automatically include it.

    Learned this when creating a new app while following a tutorial and CSRF wasn't working for pages in the new app.

提交回复
热议问题