[Fixed]-Cannot find url

1👍

You have some serious misunderstandings here.

You can’t have a template without a view. You have written a template for the profile, but you haven’t written a view. You need the view that loads the profile data and then renders the profile.html template.

Secondly, your URL has nothing to do with the template location; as you have done in regist_save, you should define a sensible URL pointing to that view – for the profile, you probably want something like r'^profile/$'.

So, the fifth entry in your urls.py should be:

url(r'^profile/$', views.profile, name='profile'),

and you need a corresponding function named profile in views.py.

Finally, when you redirect you need to use an actual URL entry – again, it has nothing to do with templates. So in your regist_save view, you should do:

return redirect('profile')

Leave a comment