mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Added 404
This commit is contained in:
parent
e8ec11e3cc
commit
9064b23cd8
@ -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)
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user