1👍
You need separate views and URL-conf for editing and detail view. You only have ^user_profile/(?P\d+)/edit/$'
in your URL-conf, so you can only access the view from user_profile/123/edit/
. So you need to add another URL '^user_profile/(?P\d+)/$
to access from user_profile/123/
.
The same with views, you need two separate ones for the simplest solution.
Source:stackexchange.com