40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
"""bk_api URL Configuration
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
https://docs.djangoproject.com/en/2.2/topics/http/urls/
|
|
Examples:
|
|
Function views
|
|
1. Add an import: from my_app import views
|
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
Class-based views
|
|
1. Add an import: from other_app.views import Home
|
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
Including another URLconf
|
|
1. Import the include() function: from django.urls import include, path
|
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
"""
|
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
|
from django.contrib import admin
|
|
from django.urls import include, path
|
|
from django.conf.urls import url
|
|
|
|
|
|
|
|
from knox import views as knox_views
|
|
from .views import LoginView
|
|
# from rest_framework.authtoken import views
|
|
from bills import endpoints
|
|
|
|
urlpatterns = [
|
|
# path('bills/', include('core.urls')),
|
|
path('api/admin/', admin.site.urls),
|
|
url('^api/', include(endpoints)),
|
|
# url(r'^api/auth/', views.obtain_auth_token)
|
|
# url(r'api/auth/', include('knox.urls'))
|
|
url(r'api/auth/login/', LoginView.as_view(), name='knox_login'),
|
|
url(r'api/auth/logout/', knox_views.LogoutView.as_view(), name='knox_logout'),
|
|
url(r'api/auth/logoutall/', knox_views.LogoutAllView.as_view(), name='knox_logoutall'),
|
|
]
|
|
|
|
urlpatterns += staticfiles_urlpatterns()
|