Answer the question
In order to leave comments, you need to log in
How to display one template for all urls?
Using DRF + React js
views.py
def index(request):
return render(request, 'index.html')
urlpatterns = [
path('', views.index)
]
<Router>
<>
<div className="site">
<div className="site-content">
<Header />
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/apps/" component={List} />
<Route exact path="/app/:slug" component={Detail} />
</Switch>
</div>
<Footer />
</div>
</>
</Router>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question