4

I'm still a novice and I'm not sure how I should setup the profile page for users. The django.contrib.auth.views.login will redirect to a accounts/profile page, but how should I actually set this up?

Is it common to just define accounts/profile in urls.py and have it redirect to a template or is it a more complex pattern?

django.views.generic.simple.direct_to_template, {'template':'profile.html'}) where profile.html lives in PROJECT_ROOT/templates/profile.html and extends base.html?

meder omuraliev
  • 183,342
  • 71
  • 393
  • 434
  • More complete answers: http://stackoverflow.com/questions/6085025/django-user-profile – ptim May 23 '16 at 23:53

2 Answers2

2

You can either set up a view/url that points to accounts/profile, or you can tell Django to redirect somewhere else after login by setting the LOGIN_REDIRECT_URL param in your settings.py.

Dominic Rodger
  • 97,747
  • 36
  • 197
  • 212
Adam
  • 7,067
  • 2
  • 27
  • 24
1

There are some reusable apps out there for handing common profile page functionality, take a look at https://bitbucket.org/ubernostrum/django-profiles/wiki/Home or http://code.google.com/p/django-profile/

Sean O Donnell
  • 1,429
  • 1
  • 12
  • 11