Are you referring to Single Page Application? You can use Django to serve the API endpoints and use a different router for front end.
I chose React and react-router-dom in this case.
import React, { Component } from "react";
import ReactDOM from "react-dom";
import {
Route,
NavLink,
HashRouter
} from "react-router-dom";
import Home from "./Home";
import About from "./About";
import Contact from "./Contact";
class App extends Component {
render() {
return (
<HashRouter>
<div>
<h1>My App</h1>
<ul className="header">
<li><NavLink to="/home">Home</NavLink></li>
<li><NavLink to="/about">About</NavLink></li>
<li><NavLink to="/contact">Contact</NavLink></li>
</ul>
<div className="content">
<Route path="/home" component={Home}/>
<Route path="/about" component={About}/>
<Route path="/contact" component={Contact}/>
</div>
</div>
</HashRouter>
)
}
}
mysite/urls.py
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('app1.urls')),
]
app1/urls.py -- Your frontend will use ajax or axios to call these endpoints to login or register a user, for example.
urlpatterns = [
path('login' views.login, name='home'),
path('register', views.register),
]
I find this tutorial really helpful when setting up webpacker for React.