url names + API default permissions
This commit is contained in:
parent
e1f8a84111
commit
7585a8246d
2 changed files with 6 additions and 6 deletions
10
api/urls.py
10
api/urls.py
|
@ -6,15 +6,15 @@ from api.event.views import EventViewSet, PlaceViewSet, ActivityTagViewSet,\
|
|||
# Create a router and register our viewsets with it.
|
||||
router = SimpleRouter()
|
||||
router.register(r'event', EventViewSet, 'event')
|
||||
router.register(r'place', PlaceViewSet)
|
||||
router.register(r'tag', ActivityTagViewSet)
|
||||
router.register(r'place', PlaceViewSet, 'place')
|
||||
router.register(r'activitytag', ActivityTagViewSet, 'activitytag')
|
||||
|
||||
# Register nested router and register someviewsets vith it
|
||||
event_router = NestedSimpleRouter(router, r'event', lookup='event')
|
||||
event_router.register(r'place', PlaceViewSet, base_name='event-names')
|
||||
event_router.register(r'tag', ActivityTagViewSet, base_name='event-names')
|
||||
event_router.register(r'place', PlaceViewSet, base_name='event-place')
|
||||
event_router.register(r'tag', ActivityTagViewSet, base_name='event-activitytag')
|
||||
event_router.register(r'activitytemplate', ActivityTemplateViewSet,
|
||||
base_name='event-names')
|
||||
base_name='event-activitytemplate')
|
||||
|
||||
|
||||
# The API URLs are now determined automatically by the router.
|
||||
|
|
|
@ -75,7 +75,7 @@ MIDDLEWARE_CLASSES = [
|
|||
|
||||
REST_FRAMEWORK = {
|
||||
'DEFAULT_PERMISSION_CLASSES': [
|
||||
'rest_framework.permissions.IsAdminUser',
|
||||
'rest_framework.permissions.AllowAny',
|
||||
],
|
||||
'PAGE_SIZE': 10
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue