Fakultas Ilmu Komputer UI

urls.py 1.86 KB
Newer Older
Bayukanta Iqbal Gunawan's avatar
a  
Bayukanta Iqbal Gunawan committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""pplbackend URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/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 import admin
from django.urls import path,include
18
from rest_framework import routers
19
from rest_framework.authtoken import views
Usman Sidiq's avatar
Usman Sidiq committed
20
21
from django.conf.urls.static import static
from django.conf import settings
22
23
import new_rest_api.views
import new_rest_api.urls
Usman Sidiq's avatar
Usman Sidiq committed
24
import oauth.views
25
26
27
28
29
from django.views.generic import TemplateView


router = routers.DefaultRouter()
#router.register(r'users', rest_api.views.UserViewSet)
30
#router.register(r'groups', rest_api.views.GroupViewSet)
31
32


Bayukanta Iqbal Gunawan's avatar
a  
Bayukanta Iqbal Gunawan committed
33
34
35

urlpatterns = [
    path('admin/', admin.site.urls),
36
37
    path('accounts/', include('allauth.urls')),
    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
38
    path('api/', include(new_rest_api.urls)),
39
    path('o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
40
    path('', include(router.urls)),
Usman Sidiq's avatar
Usman Sidiq committed
41
42
43
    path('api-token-auth/', oauth.views.request_token, name='api-token-auth'),
    path('request-token/', views.obtain_auth_token, name='token-request-auth'),
    #path('api-token-auth/', views.obtain_auth_token, name='api-token-auth'),
44
45
    path('informasi-fasilitas/', include('informasi_fasilitas.urls')),
    path('layanan-khusus/', include('layanan_khusus.urls'))
Usman Sidiq's avatar
Usman Sidiq committed
46
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)