I am using reactjs as a frontend and django as backend. React router is used for routing. When i refresh the page that has routed by react router, i get django 404 Pag
In case anyone has this same problem, in django 2.0, follow 'Kevin Martin Jose' answer but instead, replace url with re_path
from django.urls import path, re_path
urlpatterns = [
path('login/', LoginView.as_view(), name='login'),
path('logout/', LogoutView.as_view()),
path('/', login_required(TemplateView.as_view(template_name="app.html"),
login_url='login')),
re_path(r'^(?:.*)/?$', login_required(TemplateView.as_view(template_name="app.html"),
login_url='login')),
]