1

redirect back to askbot after login via own django app
 

Next question! We're trying to integrate askbot with our own django app. Currently, after the user logs in, they are not redirected back to the askbot pages.

Normally in django you would use something like

/login/?next=/askbot

to tell your login view to redirect back to a certain page... But it looks like the default Hi there! Please sign in login link in askbot does not do this... More importantly, neither does the "Login/Signup to Post" button on the pre-login "Ask your question" form...

Should we just disable the ability to post before login?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
hjwp's avatar
31
hjwp
asked 13 years ago

Comments

see more comments

1 Answer

0

Ability to post before login can be added or removed in "settings"->"data entry and display"->"allow posting before logging in".

As for the on login redirect - please try django docs there is probably a setting for the default url. If it does not work for you, please let us know and we'll fix it.

You can also use your own login application by removing the askbot.deps.django_authopenid app from the settings.py and removing the corresponding authentication middleware, then replacing them for your preferred authentication app.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 13 years ago
link

Comments

django has a setting for the post-login default redirect, LOGIN_REDIRECT_URL, and we're using it, for when users aren't in the forums. It's easily overridden by using the next= get request. SO: feature suggestion would be to have the "please sign in" link in askbot have a next= parameter set to ASKBOT_URL (I've sent you a pull request).

for people logging in while posting a question, it may just be too hard...

hjwp's avatar hjwp (13 years ago)

we'll take a look, thanks.

Evgeny's avatar Evgeny (13 years ago)

Would it be better to use the LOGIN_REDIRECT_URL instead or ASKBOT_URL, if the login redirect is not set?

Evgeny's avatar Evgeny (13 years ago)
see more comments