django-registration simple backend help

421 views
Skip to first unread message

psychok7

unread,
May 27, 2012, 8:54:20 PM5/27/12
to django...@googlegroups.com
hi there i am writing an app using django-registration 0.8 installed from pip and using the simple-backend

my problem is, when i register a new user it logs me in after inserting in the db and redirects me to /users/<username>/ but if i login normally using the django.contrib.auth it redirects me to accounts/profile.

my question is, how do i unify this redirect since it should take me to the same place?

thanks

psychok7

unread,
May 28, 2012, 2:18:46 PM5/28/12
to django...@googlegroups.com
anyone?

Rafael Durán Castañeda

unread,
May 28, 2012, 3:15:28 PM5/28/12
to django...@googlegroups.com
El 28/05/12 20:18, psychok7 escribió:
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/okwBS3_w15gJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
From django-registration docs:

Upon successful registration, the default redirect is to the URL specified by the get_absolute_url() method of the newly-created User object; by default, this will be /users/<username>/, although it can be overridden in either of two ways:

  1. Specify a custom URL pattern for the register() view, passing the keyword argument success_url.
  2. Override the default get_absolute_url() of the User model in your Django configuration, as covered in Django’s settings documentation.

http://docs.b-list.org/django-registration/0.8/simple-backend.html

HTH

psychok7

unread,
May 28, 2012, 3:28:25 PM5/28/12
to django...@googlegroups.com
yes i read that part before posting, but i just dont understand the beahaviour of the normal login that redirects me somewhere and the login after registration that redirects me elsewhere. wich one should i use?


On Monday, May 28, 2012 8:15:28 PM UTC+1, Rafael Durán Castañeda wrote:
El 28/05/12 20:18, psychok7 escribió:
anyone?

On Monday, May 28, 2012 1:54:20 AM UTC+1, psychok7 wrote:
hi there i am writing an app using django-registration 0.8 installed from pip and using the simple-backend

my problem is, when i register a new user it logs me in after inserting in the db and redirects me to /users/<username>/ but if i login normally using the django.contrib.auth it redirects me to accounts/profile.

my question is, how do i unify this redirect since it should take me to the same place?

thanks
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/okwBS3_w15gJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Rafael Durán Castañeda

unread,
May 28, 2012, 4:13:37 PM5/28/12
to django...@googlegroups.com
El 28/05/12 21:28, psychok7 escribi�:
yes i read that part before posting, but i just dont understand the beahaviour of the normal login that redirects me somewhere and the login after registration that redirects me elsewhere. wich one should i use?

On Monday, May 28, 2012 8:15:28 PM UTC+1, Rafael Dur�n Casta�eda wrote:
El 28/05/12 20:18, psychok7 escribi�:
anyone?

On Monday, May 28, 2012 1:54:20 AM UTC+1, psychok7 wrote:
hi there i am writing an app using django-registration 0.8 installed from pip and using the simple-backend

my problem is, when i register a new user it logs me in after inserting in the db and redirects me to /users/<username>/ but if i login normally using the�django.contrib.auth it redirects me to accounts/profile.

my question is, how do i unify this redirect since it should take me to the same place?

thanks
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/okwBS3_w15gJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
From django-registration docs:

Upon successful registration, the default redirect is to the URL specified by the get_absolute_url() method of the newly-created User object; by default, this will be /users/<username>/, although it can be overridden in either of two ways:

  1. Specify a custom URL pattern for the register() view, passing the keyword argument success_url.
  1. Override the default get_absolute_url() of the User model in your Django configuration, as covered in Django�s settings documentation.

http://docs.b-list.org/django-registration/0.8/simple-backend.html

HTH
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/T_tBN05Lbk4J.

To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Django, by default, redirects you to LOGIN_URL after successful login unless next is given as query string (see https://docs.djangoproject.com/en/dev/topics/auth/#the-login-required-decorator), accounts/profile in your case, and registration backend is redirecting you to /users/<username>. So you can change LOGIN_URL or override registration redirects as docs explain.

Bye

Rafael Durán Castañeda

unread,
May 28, 2012, 4:43:34 PM5/28/12
to django...@googlegroups.com
El 28/05/12 22:13, Rafael Dur�n Casta�eda escribi�:
I've just realized, my las message is wrong, LOGIN_REDIRECT is where users are redirected by default (https://docs.djangoproject.com/en/dev/ref/settings/#login-redirect-url) and I didn't mention that also depends of your login view (but I think not in this case).

Bye

psychok7

unread,
May 28, 2012, 10:07:07 PM5/28/12
to django...@googlegroups.com
i followed your tips and  got my answer here http://stackoverflow.com/questions/3441436/the-next-parameter-redirect-django-contrib-auth-login 

thanks ;)
Django, by default, redirects you to LOGIN_URL after successful login unless next is given as query string (see https://docs.djangoproject.com/en/dev/topics/auth/#the-login-required-decorator), accounts/profile in your case, and registration backend is redirecting you to /users/<username>. So you can change LOGIN_URL or override registration redirects as docs explain.

Bye
Reply all
Reply to author
Forward
0 new messages