.
This commit is contained in:
+74
-43
@@ -23,39 +23,54 @@ 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 rest_framework import routers
|
||||
|
||||
from django.conf.urls import (
|
||||
handler400, handler403, handler404, handler500
|
||||
)
|
||||
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")
|
||||
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("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/bulk_create/", views.accounts_bulk_create, name="accounts_bulk_create"),
|
||||
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/bulk_create/", views.accounts_bulk_create, name="accounts_bulk_create"
|
||||
),
|
||||
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.UserListView.as_view(), name="accounts_list"),
|
||||
path("accounts/", include("django.contrib.auth.urls")),
|
||||
path("accounts/profile", views.profile, name="profile"),
|
||||
@@ -68,44 +83,60 @@ urlpatterns = [
|
||||
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/<int:cid>/<str:passcode>",
|
||||
views.active_exams,
|
||||
name="active_exams_cid",
|
||||
),
|
||||
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('', 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/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('select2/', include('select2.urls')),
|
||||
|
||||
path("api/", include(router.urls)),
|
||||
path("api-auth/", include("rest_framework.urls")),
|
||||
path("tinymce/", include("tinymce.urls")),
|
||||
# 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'
|
||||
# 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")
|
||||
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 = [
|
||||
|
||||
+3
-3
@@ -493,7 +493,7 @@ def view_feedback(request):
|
||||
def page_not_found(request, exception):
|
||||
response = render(request, "404.html", {})
|
||||
|
||||
# response.status_code = 404
|
||||
response.status_code = 404
|
||||
|
||||
return response
|
||||
|
||||
@@ -501,7 +501,7 @@ def page_not_found(request, exception):
|
||||
def page_forbidden(request, exception):
|
||||
response = render(request, "403.html", {})
|
||||
|
||||
# response.status_code = 404
|
||||
response.status_code = 403
|
||||
|
||||
return response
|
||||
|
||||
@@ -509,7 +509,7 @@ def page_forbidden(request, exception):
|
||||
def server_error(request):
|
||||
response = render(request, "500.html", {})
|
||||
|
||||
# response.status_code = 404
|
||||
response.status_code = 500
|
||||
|
||||
return response
|
||||
|
||||
|
||||
Reference in New Issue
Block a user