0

We are using Django as backend and Angular as front end and templating. I am doing the front end part.

When I designed the UI the url was

xxx/dashboard.html#/

but while intergeating I get

xxx/dashboard/#/

so whats the difference.

Also my routeprovider in Angular is throwing 404 error

$routeProvider
.when('/', {
    templateUrl: 'pages/dash_home.html',
    controller: 'dashController'
})

My Html

<!doctype html>
{% load staticfiles %}
<html class="no-js" lang="en">
<head>
    ....        
</head>
<body ng-app="gb_dash">
{% block content %}
    <div class="fullWidth">
        <div ng-view>...

My app structure

>apps
>deployment
...
...
>static
    >bower_components
    ...
    ...
    >js
        dash.js //angular_app
>templates
    >pages
        dash_home.html
    dashboard.html

I am getting error

GET http://127.0.0.1:8000/static/templates/pages/dash_home.html 404 (NOT FOUND)

Where am i mistaking. I tried html5mode, then no error showing but still the template didnt load. Or is there backend mistake?

1 Answer 1

1

It would be helpful if you use

xxx/dashboard.html#/

then in the route provider

$routeProvider
.when('/', {
    templateUrl: '#/pages/dash_home.html',
    controller: 'dashController'
})

It will look for the # and then attach the url with it.

Sign up to request clarification or add additional context in comments.

3 Comments

Actually I am the front end developer. The basic route i was given is preceded with / before #. I'll ask my backend team. Also If i use # in the templateUrl, Multiple pages are loading in the same page.
okay, can you give an example of the working url that loads the page?
localhost:8080/gb_front/dashboard.html# This is what is suppose to get but i am receiving localhost:8000/testschool/dashboard/# . never mind the domain that is after django implementation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.