update urls.pyes to use path() and add some tests
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
"""URL patterns for the karma views."""
|
||||
|
||||
from django.conf.urls import url, include
|
||||
from django.conf.urls import include
|
||||
from django.urls import path
|
||||
from rest_framework.routers import DefaultRouter
|
||||
|
||||
from karma.views import key_detail, index, KarmaKeyViewSet
|
||||
from karma.views import KarmaKeyViewSet, index, key_detail
|
||||
|
||||
router = DefaultRouter()
|
||||
router.register(r'keys', KarmaKeyViewSet)
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', index, name='karma_index'),
|
||||
url(r'^key/(?P<karma_key>.+)/', key_detail, name='karma_key_detail'),
|
||||
path('', index, name='karma_index'),
|
||||
path('key/<karma_key>/', key_detail, name='karma_key_detail'),
|
||||
|
||||
url(r'^api/', include(router.urls)),
|
||||
path('api/', include(router.urls)),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user