I'm trying to use reactjs
and react-router
( 1.x
) with my Django app, but it's hard for me to put all this together. Here is the github project just incase I do not provide enough information in this matter.
https://github.com/liondancer/django-cherngloloong
I created path="about"
in myroutes.js
var routes = (
<Router>
<Route path="/" component={ Views.Layout }>
<IndexRoute component={ Views.Index } />
<Route path="about" component={ Views.About } />
</Route>
<Route path="*" component={ Views.RouteNotFound } />
</Router>
);
export default routes;
My layout.js
class Layout extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div id="review-web">
<header className="header">
<LogoElement />
<CenterPiece />
</header>
<div>
{ React.cloneElement(this.props.children, { path: this.props.path }) }
</div>
<Footer />
</div>
);
}
}
export default Layout;
When I enter localhost.8000/about
, I get a 404
Django error
My goal is to keep the interface and backend separate, so I think I should use Django as an endpoint for data, not view views.
source
share