I've noticed that after I log in with Django registration it redirects me to accounts/profile/
. By default Django registration's url.py
doesn't handle accounts/profile/
, so I need to create my own.
Actually this questions is three-fold:
- Why does after logging in, it redirects to
accounts/profile/
? Is there a way to change that? Preferably after successfully logging in I would like Django to redirect back to the page before the login page. - If I were to create my own view and template for
accounts/profile/
, then where should I put it? Django's built-inusers
(auth_user
) is shared among all Django apps inside a project, so should I place theview.py
in the project folder and not inside the app folder? - Or does Django profile actually takes care of this whole
account/profiles/
thing? I already extended Django'sUser
class with my ownUserProfile
, but it's more like additional fields to theUser
table than an actual "profile" (I didn't create avatars or anything like that, just simple stuff like addresses and phone numbers, but most importantly, some custom user types that my app depends on).
login_required
but wasn’t using it. It needs to be applied otherwise the profile page can be visited without login (although it’ll probably not show much since there won’t be a user). I fixed it now but didn’t test it. – Haehaecceity