[Fixed]-Using Django URLs with AngularJs routeProvider


I think you’re pretty close, there is few things to make this works(honestly, this is confusing to understand and I hope I didn’t forget anything).

First, your URLs order is important, if you define something before the angular routes they will be rendered first, so use your django app’s urls before the angular one.

Then, if you want to make angular know about the sub-path you need to define <base> tag in your header. In your case:

<base href="/projectkeeper/" />

(you can also define projectkeeperit in all of your where functions tho).

For the urls, I would change the regex to: r'^projectkeeper/.*'. Again, should be the last one in your urls list.

You will encounter other issues like the {{ }}, authentication issues, but those will stay for a different answer 🙂


Try out this ui router for angularJS

It will be more helpful on nested views and problem like which you are facing currently.

Leave a comment