urls.py 854 Bytes
Newer Older
David Haynes's avatar
David Haynes committed
1
2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
David Haynes's avatar
David Haynes committed
3
4
5
6
7
"""
settings/urls.py

Top level url patterns.
"""
8
# Django Imports
David Haynes's avatar
David Haynes committed
9
from django.urls import include, path
10
from django.contrib import admin
11
12
import django.contrib.auth.views

David Haynes's avatar
David Haynes committed
13
# Automatically populate the admin pages
14
15
admin.autodiscover()

David Haynes's avatar
David Haynes committed
16
# Define all the top level url patterns in a list
17
urlpatterns = [
David Haynes's avatar
David Haynes committed
18
    # / - Load in all urls from the `api` app
David Haynes's avatar
David Haynes committed
19
    path('', include('api.urls')),
20
21

    # /admin/docs - Documentation for admin
David Haynes's avatar
David Haynes committed
22
    path('admin/doc/', include('django.contrib.admindocs.urls')),
23

David Haynes's avatar
David Haynes committed
24
    # /admin - The admin panels
David Haynes's avatar
David Haynes committed
25
    path('admin/', admin.site.urls),
David Haynes's avatar
David Haynes committed
26

27
    # /api-auth - API Auth page
David Haynes's avatar
David Haynes committed
28
    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
Daniel Bond's avatar
Daniel Bond committed
29

30
    # /logout - Redirect to the homepage on logout
David Haynes's avatar
David Haynes committed
31
    path('logout/', django.contrib.auth.views.logout, {'next_page': '/'}),
32
]