Reverse for 'edit' with no arguments not found. 1 pattern(s) tried: ['articles/edit/(?P[0-9]+)/$']

前端 未结 1 1177
面向向阳花
面向向阳花 2021-01-21 04:58

I am a beginner in Django and now i am developing a blogging application. At the article editing section i got stucked and I dont know why its showing this error. Searched a lot

1条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-21 05:36

    In your template article_edit.html - post url is expecting a pk, you need to pass a pk just like you are doing it for template my_articles.html

    {% csrf_token %}...

    This way django knows which article you are editing

    0 讨论(0)
提交回复
热议问题