3

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
  • 177,923
  • 69
  • 381
  • 426
  • 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
  • 94,357
  • 33
  • 195
  • 210
Adam
  • 6,659
  • 2
  • 26
  • 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,303
  • 1
  • 11
  • 11