Organizational Research By

Surprising Reserch Topic

how to redirect from django views to a specific view of angular js


how to redirect from django views to a specific view of angular js  using -'angularjs,django,django-templates,django-views'

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
    
asked Oct 11, 2015 by vijaygupta1980
0 votes
4 views



Related Hot Questions



Government Jobs Opening


...