Added 404

This commit is contained in:
Oliver Walters 2017-04-14 15:16:16 +10:00
parent e8ec11e3cc
commit 9064b23cd8

View File

@ -1,8 +1,19 @@
from django.conf.urls import url, include
from django.contrib import admin
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view
admin.site.site_header = "InvenTree Admin"
@api_view()
def Inventree404(self):
""" Supplied URL is invalid
"""
content = {'detail': 'Malformed API URL'}
return Response(content, status=status.HTTP_404_NOT_FOUND)
urlpatterns = [
url(r'^stock/', include('stock.urls')),
url(r'^part/', include('part.urls')),
@ -10,5 +21,8 @@ urlpatterns = [
url(r'^track/', include('track.urls')),
url(r'^project/', include('project.urls')),
url(r'^admin/', admin.site.urls),
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework'))
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
# Any other URL
url(r'', Inventree404)
]