urls.py 686 Bytes
Newer Older
Florent Chehab's avatar
Florent Chehab committed
1
2
3
from django.conf.urls import url, include
from rex import views
from rest_framework import routers
4
from rex.models.location import CountryViewSet, CityViewSet
Florent Chehab's avatar
Florent Chehab committed
5
from rex.models.university import MainCampusViewSet, UniversityViewSet
Florent Chehab's avatar
Florent Chehab committed
6
from rest_framework.documentation import include_docs_urls
Florent Chehab's avatar
Florent Chehab committed
7

Florent Chehab's avatar
Florent Chehab committed
8

Florent Chehab's avatar
Florent Chehab committed
9
urlpatterns = [
10
    url(r'^$', views.home, name='home'),
Florent Chehab's avatar
Florent Chehab committed
11
    url(r'^api-docs/', include_docs_urls(title='Outgoing API'))
Florent Chehab's avatar
linting    
Florent Chehab committed
12
]
Florent Chehab's avatar
Florent Chehab committed
13
14
15
16


router = routers.DefaultRouter()
router.register(r'country', CountryViewSet)
Florent Chehab's avatar
Florent Chehab committed
17
router.register(r'city', CityViewSet)
Florent Chehab's avatar
Florent Chehab committed
18
router.register(r'main-campus', MainCampusViewSet)
Florent Chehab's avatar
Florent Chehab committed
19
router.register(r'university', UniversityViewSet)
Florent Chehab's avatar
Florent Chehab committed
20
21

urlpatterns += [url(r'^api/', include(router.urls))]