164 lines
6.2 KiB
Python
164 lines
6.2 KiB
Python
"""mysite URL Configuration
|
|
|
|
The `urlpatterns` list routes URLs to views. For more information please see:
|
|
https://docs.djangoproject.com/en/2.0/topics/http/urls/
|
|
Examples:
|
|
Function views
|
|
1. Add an import: from my_app import views
|
|
2. Add a URL to urlpatterns: path('', views.home, name='home')
|
|
Class-based views
|
|
1. Add an import: from other_app.views import Home
|
|
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
|
|
Including another URLconf
|
|
1. Import the include() function: from django.urls import include, path
|
|
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
|
"""
|
|
from django.contrib import admin
|
|
from django.urls import path, include
|
|
from django.conf import settings
|
|
from django.conf.urls.static import static
|
|
from django.views.generic import TemplateView
|
|
|
|
|
|
from . import views
|
|
|
|
|
|
from rapids import views as rapid_views
|
|
from anatomy import views as anatomy_views
|
|
from longs import views as long_views
|
|
|
|
from generic import views as generic_views
|
|
|
|
from rest_framework import routers
|
|
|
|
from django.conf.urls import handler400, handler403, handler404, handler500
|
|
|
|
router = routers.DefaultRouter()
|
|
router.register(r"rapids/exams", rapid_views.ExamViewSet, basename="rapid-exam")
|
|
router.register(r"anatomy/exams", anatomy_views.ExamViewSet, basename="anatomy-exam")
|
|
router.register(r"longs/exams", long_views.ExamViewSet, basename="long-exam")
|
|
router.register(
|
|
r"rapids/answers",
|
|
rapid_views.QuestionAnswerViewSet,
|
|
basename="rapid-question-answers",
|
|
)
|
|
router.register(
|
|
r"rapids/user_answer",
|
|
rapid_views.UserAnswerViewSet,
|
|
basename="rapid-question-answers",
|
|
)
|
|
router.register(r"rapids", rapid_views.RapidViewSet, basename="rapid")
|
|
# router.register(r'rapids/laterality', rapid_views.RapidLateralityViewSet, basename="rapid")
|
|
|
|
urlpatterns = [
|
|
path("admin/", admin.site.urls, name="admin"),
|
|
path("anatomy/", include("anatomy.urls"), name="anatomy"),
|
|
path("physics/", include("physics.urls"), name="physics"),
|
|
# path("sbas/", include("sbas.urls"), name="sbas"),
|
|
path("rapids/", include("rapids.urls"), name="rapids"),
|
|
path("longs/", include("longs.urls"), name="longs"),
|
|
path("sbas/", include("sbas.urls"), name="sbas"),
|
|
path("generic/", include("generic.urls"), name="generic"),
|
|
path("atlas/", include("atlas.urls"), name="atlas"),
|
|
path(
|
|
"accounts/check_users", views.accounts_check_users, name="accounts_check_users"
|
|
),
|
|
path(
|
|
"accounts/bulk_create/", views.accounts_bulk_create, name="accounts_bulk_create"
|
|
),
|
|
path(
|
|
"accounts/create/", generic_views.create_user, name="create_user"
|
|
),
|
|
path(
|
|
"accounts/update/<str:slug>/",
|
|
views.UpdateUserView.as_view(),
|
|
name="account_update",
|
|
),
|
|
path(
|
|
"accounts/update_profile/<str:slug>/",
|
|
views.UpdateUserProfileView.as_view(),
|
|
name="account_profile_update",
|
|
),
|
|
path("accounts/", views.UserListTableView.as_view(), name="accounts_list"),
|
|
#path("accounts/", views.UserListView.as_view(), name="accounts_list"),
|
|
path("accounts/", include("django.contrib.auth.urls")),
|
|
path("accounts/profile", views.profile, name="profile"),
|
|
path("accounts/profile/<str:slug>/", views.account_profile, name="account_profile"),
|
|
path("", TemplateView.as_view(template_name="index.html"), name="home"),
|
|
path("cid/results/<int:cid>/", views.cid_results, name="cid_results"),
|
|
path("cid/<int:cid>/<str:passcode>", views.cid_scores, name="cid_scores"),
|
|
path("cid/<int:cid>/", views.cid_scores_admin, name="cid_scores_admin"),
|
|
path("user/scores", views.user_scores, name="user_scores"),
|
|
path("cid/", views.cid_selector, name="cid_selector"),
|
|
# Global url that registers RTS compatible exams
|
|
path("exam/json/", views.active_exams, name="active_exams"),
|
|
path(
|
|
"exam/json/<int:cid>/<str:passcode>",
|
|
views.active_exams,
|
|
name="active_exams_cid",
|
|
),
|
|
path(
|
|
"exam/json/unbased/<int:cid>/<str:passcode>",
|
|
views.active_exams_unbased,
|
|
name="active_exams_cid_unbased",
|
|
),
|
|
path("exam/json/unbased", views.active_exams_unbased, name="active_exams_unbased"),
|
|
path("exam/submit", views.exam_submit, name="global_exam_answers_submit"),
|
|
# path('', include('generic.urls')),
|
|
path(
|
|
"feedback/<str:question_type>/<int:pk>",
|
|
views.AddQuestionNote.as_view(),
|
|
name="feedback_create",
|
|
),
|
|
path(
|
|
"feedback/note/<int:pk>/complete",
|
|
views.feedback_mark_complete,
|
|
name="feedback_mark_complete",
|
|
),
|
|
path(
|
|
"feedback/note/<int:pk>/delete",
|
|
views.feedback_note_delete,
|
|
name="feedback_note_delete",
|
|
),
|
|
# path("feedback/", views.AddQuestionNote.as_view(), name="feedback"),
|
|
path(
|
|
"feedback/answer",
|
|
views.answer_suggestion_submit,
|
|
name="answer_suggestion_submit",
|
|
),
|
|
path("feedback/answer_submit", views.answer_submit, name="answer_submit"),
|
|
path(
|
|
"feedback/answer/confirm",
|
|
views.answer_suggestion_confirm,
|
|
name="answer_suggestion_confirm",
|
|
),
|
|
path("feedback/view", views.view_feedback, name="view_feedback"),
|
|
path("api/", include(router.urls)),
|
|
path("api-auth/", include("rest_framework.urls")),
|
|
path("tinymce/", include("tinymce.urls")),
|
|
path("cookies/", include("cookie_consent.urls")),
|
|
#path("cookies/", include("cookie_consent.urls")),
|
|
path("privacy/", views.privacy_view, name="privacy"),
|
|
# path('select2/', include('select2.urls')),
|
|
]
|
|
|
|
# handler400 = 'my_app.views.bad_request'
|
|
handler403 = "rad.views.page_forbidden"
|
|
handler404 = "rad.views.page_not_found"
|
|
handler500 = "rad.views.server_error"
|
|
# handler500 = 'my_app.views.server_error'
|
|
|
|
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
|
|
if settings.DEBUG:
|
|
#urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
|
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
|
|
urlpatterns += static("/rts/", document_root="rts")
|
|
import debug_toolbar
|
|
|
|
urlpatterns = [
|
|
path("__debug__/", include(debug_toolbar.urls)),
|
|
# For django versions before 2.0:
|
|
# url(r'^__debug__/', include(debug_toolbar.urls)),
|
|
] + urlpatterns
|