urls.py 1.05 KB
Newer Older
Ben Waters's avatar
Ben Waters committed
1
from django.conf.urls import patterns, include, url
Ben Waters's avatar
Ben Waters committed
2
from django.views.generic import TemplateView
Ben Waters's avatar
Ben Waters committed
3
4
from mainapp.views import * 
from mainapp.models import * 
Ben Waters's avatar
Ben Waters committed
5
6
7
8

from rest_framework.routers import DefaultRouter

router = DefaultRouter()
Ben Waters's avatar
Ben Waters committed
9
10
11
12
router.register(r'programs', ProgramViewSet)
router.register(r'courses', CourseViewSet)
router.register(r'coursegroups', CourseGroupViewSet)
router.register(r'trajectories', TrajectoryViewSet)
Ben Waters's avatar
Ben Waters committed
13
router.register(r'semesters', SemesterViewSet)
Ben Waters's avatar
Ben Waters committed
14
router.register(r'buildresponses', BuildResponseViewSet)
Ben Waters's avatar
Ben Waters committed
15
router.register(r'requirements', RequirementViewSet)
Ben Waters's avatar
Ben Waters committed
16
17
18
19
20

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'advisor.views.home', name='home'),
    # url(r'^blog/', include('blog.urls')),
Ben Waters's avatar
Ben Waters committed
21
    url(r'^$', TemplateView.as_view(template_name='index.html'), name='index'),
Ben Waters's avatar
Ben Waters committed
22
    url(r'^api/', include(router.urls)),
Ben Waters's avatar
Ben Waters committed
23
    url(r'^build/', build_trajectory, name='build'),
24
    url(r'^student/(?P<slug>[^/]+)/$', DetailStudent.as_view(),
Ben Waters's avatar
Ben Waters committed
25
    name='detail-student'),
26
    url(r'^profile/(?P<slug>[^/]+)/$', ProfileView.as_view(), 
27
    name='profile'),
Ben Waters's avatar
Ben Waters committed
28
29
)