[Fixed]-Using Django URLs with AngularJs routeProvider

4๐Ÿ‘

โœ…

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 ๐Ÿ™‚

๐Ÿ‘คOr Duan

0๐Ÿ‘

Try out this ui router for angularJS
https://github.com/angular-ui/ui-router

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

๐Ÿ‘คramanathan

Leave a comment