El 28/05/12 22:13, Rafael Durán Castañeda escribió:
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
    <https://groups.google.com/d/msg/django-users/-/okwBS3_w15gJ>.
    To post to this group, send email to
    django-users@googlegroups.com
    <mailto:django-users@googlegroups.com>.
    To unsubscribe from this group, send email to
    django-users+unsubscr...@googlegroups.com
    <mailto:django-users+unsubscr...@googlegroups.com>.
    For more options, visit this group at
    http://groups.google.com/group/django-users?hl=en
    <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()
        
<http://docs.b-list.org/django-registration/0.8/views.html#registration.views.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.djangoproject.com/en/dev/ref/settings/#absolute-url-overrides>.

    http://docs.b-list.org/django-registration/0.8/simple-backend.html 
<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-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscr...@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
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

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to