django cross-site reverse a url
Posted
by tutuca
on Stack Overflow
See other posts from Stack Overflow
or by tutuca
Published on 2010-04-06T16:17:33Z
Indexed on
2010/04/06
23:13 UTC
Read the original article
Hit count: 517
I have a similar question than django cross-site reverse. But i think I can't apply the same solution.
I'm creating an app that lets the users create their own site. After completing the signup form the user should be redirected to his site's new post form. Something along this lines:
new_post_url = 'http://%s.domain:9292/manage/new_post %site.domain'
logged_user = authenticate(username=user.username, password=user.password)
if logged_user is not None:
login(request, logged_user)
return redirect(new_product_url)
Now, I know that "new_post_url" is awful and makes babies cry so I need to reverse it in some way. I thought in using django.core.urlresolvers.reverse to solve this but that only returns urls on my domain, and not in the user's newly created site, so it doesn't works for me.
So, do you know a better/smarter way to solve this?
© Stack Overflow or respective owner