问题
I am working on something which has combo of Django and Angular JS. As the word goes, it little tricky to mix these two. I have everything working fine and so i decided to apply User Authentication. I have applied @login_required which redirects user to login page if not logged in , before checking out.
urls.py
url(r'^checkout/$','ecommerce.views.checkout'),
views.py
@login_required
def checkout(request):
return render_to_response('#checkout0',content_type="text")
app.js
.when('/checkout0', {
templateUrl: "../static/views/checkout-0.html",
controller: "CartController"
})
This anagular-routing is working absolutely fine when clicked through
<a href="#checkout0"> checkout </a>
How exactly to write return render_to_response('#checkout0',content_type="text")
so that my page opens up with angular's checkout0
view. Any help
来源:https://stackoverflow.com/questions/33063810/how-to-redirect-from-django-views-to-a-specific-view-of-angular-js