2015-06-26 07:59:53 +00:00
|
|
|
# coding=utf-8
|
|
|
|
from django.conf.urls import include, url
|
|
|
|
from django.contrib import admin
|
|
|
|
from django.views.generic import TemplateView
|
|
|
|
|
2015-08-09 04:58:31 +00:00
|
|
|
from account.views import (UserLoginAPIView, UsernameCheckAPIView, UserRegisterAPIView,
|
|
|
|
UserChangePasswordAPIView, EmailCheckAPIView,
|
|
|
|
UserAPIView, UserAdminAPIView)
|
2015-08-06 08:28:59 +00:00
|
|
|
from announcement.views import AnnouncementAPIView, AnnouncementAdminAPIView
|
2015-08-11 06:50:33 +00:00
|
|
|
from group.views import GroupAdminAPIView, GroupMemberAdminAPIView, JoinGroupAPIView
|
2015-08-05 11:45:35 +00:00
|
|
|
from admin.views import AdminTemplateView
|
2015-08-10 07:20:17 +00:00
|
|
|
|
2015-08-09 12:03:22 +00:00
|
|
|
from problem.views import ProblemAdminAPIView
|
2015-08-10 09:59:39 +00:00
|
|
|
from problem.views import TestCaseUploadAPIView, ProblemTagAdminAPIView
|
2015-08-10 04:25:35 +00:00
|
|
|
|
2015-06-29 04:43:17 +00:00
|
|
|
|
2015-06-26 07:59:53 +00:00
|
|
|
urlpatterns = [
|
2015-08-09 14:06:23 +00:00
|
|
|
url(r'^install/$', "install.views.install"),
|
2015-08-02 01:59:13 +00:00
|
|
|
url("^$", TemplateView.as_view(template_name="oj/index.html"), name="index_page"),
|
2015-06-29 04:43:17 +00:00
|
|
|
url(r'^docs/', include('rest_framework_swagger.urls')),
|
2015-08-05 11:45:35 +00:00
|
|
|
url(r'^admin/$', TemplateView.as_view(template_name="admin/admin.html"), name="admin_spa_page"),
|
2015-08-02 01:59:13 +00:00
|
|
|
url(r'^login/$', TemplateView.as_view(template_name="oj/account/login.html"), name="user_login_page"),
|
2015-08-04 08:05:40 +00:00
|
|
|
url(r'^register/$', TemplateView.as_view(template_name="oj/account/register.html"), name="user_register_page"),
|
|
|
|
url(r'^change_password/$', TemplateView.as_view(template_name="oj/account/change_password.html"), name="user_change_password_page"),
|
2015-06-29 04:43:17 +00:00
|
|
|
url(r'^api/login/$', UserLoginAPIView.as_view(), name="user_login_api"),
|
2015-08-03 10:45:26 +00:00
|
|
|
url(r'^api/register/$', UserRegisterAPIView.as_view(), name="user_register_api"),
|
2015-08-03 11:54:55 +00:00
|
|
|
url(r'^api/change_password/$', UserChangePasswordAPIView.as_view(), name="user_change_password_api"),
|
2015-08-03 08:52:31 +00:00
|
|
|
url(r'^api/username_check/$', UsernameCheckAPIView.as_view(), name="username_check_api"),
|
2015-08-05 12:11:25 +00:00
|
|
|
url(r'^api/email_check/$', EmailCheckAPIView.as_view(), name="email_check_api"),
|
2015-08-06 08:28:59 +00:00
|
|
|
url(r'^api/admin/announcement/$', AnnouncementAdminAPIView.as_view(), name="announcement_admin_api"),
|
2015-08-07 12:25:06 +00:00
|
|
|
url(r'^api/admin/user/$', UserAdminAPIView.as_view(), name="user_admin_api"),
|
2015-08-02 00:50:19 +00:00
|
|
|
url(r'^problem/(?P<problem_id>\d+)/$', "problem.views.problem_page", name="problem_page"),
|
2015-08-10 07:01:40 +00:00
|
|
|
url(r'^announcement/(?P<announcement_id>\d+)/$', "announcement.views.announcement_page", name="announcement_page"),
|
2015-06-29 04:43:17 +00:00
|
|
|
|
2015-08-06 08:49:48 +00:00
|
|
|
url(r'^api/announcements/$', AnnouncementAPIView.as_view(), name="announcement_list_api"),
|
2015-08-09 13:00:16 +00:00
|
|
|
url(r'^api/admin/users/$', UserAPIView.as_view(), name="user_list_api"),
|
2015-08-06 08:28:59 +00:00
|
|
|
|
2015-08-02 01:59:13 +00:00
|
|
|
url(r'^admin/contest/$', TemplateView.as_view(template_name="admin/contest/add_contest.html"), name="add_contest_page"),
|
2015-08-02 08:58:41 +00:00
|
|
|
url(r'^problems/$', TemplateView.as_view(template_name="oj/problem/problem_list.html"), name="problem_list_page"),
|
2015-08-09 04:58:31 +00:00
|
|
|
url(r'^admin/template/(?P<template_dir>\w+)/(?P<template_name>\w+).html', AdminTemplateView.as_view(), name="admin_template"),
|
|
|
|
url(r'^api/admin/group/$', GroupAdminAPIView.as_view(), name="group_admin_api"),
|
2015-08-11 06:50:33 +00:00
|
|
|
url(r'^api/admin/group_member/$', GroupMemberAdminAPIView.as_view(), name="group_member_admin_api"),
|
|
|
|
url(r'^api/admin/group_join/$', JoinGroupAPIView.as_view(), name="group_join_admin_api"),
|
2015-08-10 07:20:17 +00:00
|
|
|
url(r'^api/admin/problem/$', ProblemAdminAPIView.as_view(), name="problem_admin_api"),
|
2015-08-10 04:25:35 +00:00
|
|
|
url(r'^api/admin/test_case_upload/$', TestCaseUploadAPIView.as_view(), name="test_case_upload_api"),
|
2015-08-10 09:59:39 +00:00
|
|
|
url(r'^api/admin/tag/$', ProblemTagAdminAPIView.as_view(), name="problem_tag_admin_api"),
|
2015-08-10 12:19:22 +00:00
|
|
|
url(r'^problem/(?P<problem_id>\d+)/my_solutions/', "problem.views.problem_my_solutions_list_page", name="problem_my_solutions_page"),
|
|
|
|
url(r'^my_solution/(?P<solution_id>\d+)/$', "problem.views.my_solution", name="my_solution_page"),
|
2015-06-26 07:59:53 +00:00
|
|
|
]
|