I'm creating a blog website and I want it to be that when a user update a post, I want to redirect them to the view page for that article.
the urls.py
url_patterns = [
path('view/<str:id>/, views.viewPost, name='viewpost'),
path('update/<str:id>/, views.updatePost, name='updatepost')
]
My problem is that, I want to be able to redirect to the viewpost when I update a post
I tried
return redirect('viewpost' id)
But it was giving me an error
Thanks for your contribution