from django.http import HttpResponse
from django.urls import re_path
def http_response(request):
return HttpResponse('<h1>Hello HttpResponse</h1>')
urlpatterns = [
path('ajaxlogin', views.ajax_login, name='ajaxlogin'),
path('ajaxprofile', views.ajax_profile, name='ajaxprofile'),
path('every-other-url', views.another_view, name='path-everything-else'),
re_path(r'.*', http_response), # only if the above routes don't trigger a match
]
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^api/', include('project.api')),
url(r'^', include('places.urls')),
# catch all other urls
url(r'^.*/$', views.redirect_to_home,name='redirect-to-home'),
]