1👍
✅
Add a pattern that match any url at the end of the url patterns:
from django.shortcuts import redirect
urlpatterns = patterns('',
url(r'^$', views.main, name='main'),
url(r'^login/$', views.login, name='login'),
url(r'^app/$',views.app, name='app'),
url(r'^.*$', redirect('/')), # <------------
)
Source:stackexchange.com