Hello all,
I’ve run into an issue with my URLs which I cannot resolve. It’s probably something trivial but I think I’ve been staring at the problem so long that I’ve overlooked something simple.
I have added a new app called cas_auth
and it is configured in my settings.py
and all looks ands *runs well.
Note also that APPEND_SLASH = True
The issue is simply that I am getting 404s when accessing URLs which should be there and for which the configuration of the requisite URL files looks sound, at least to me.
In my root urls.py
I have the following (this is a very small preview of the entire file).
CAS URLs issue
urlpatterns = [
path("api/v1/cas/", include("cas_auth.urls")), # this has never worked. It is the first item in the list
path(f"api/v1/case-builder/", include("case_builder.urls")), # this one has stopped working
...
]
The cas_auth.urls.py
looks like this:
from django.urls import path
import django_cas_ng.views
urlpatterns = [
path("login", django_cas_ng.views.LoginView.as_view(), name='cas_ng_login'),
path("logout", django_cas_ng.views.LogoutView.as_view(), name='cas_ng_logout'),
path("", django_cas_ng.views.LoginView.as_view(), name='cas_ng_login_default'),
]
The issue with my CAS urls is that none of the following URLs work:
- /api/v1/cas/login
- /api/v1/cas/logout
- /api/v1/cas
- /api/v1/cas/
All return a 404. The Django debug in the browser even lists the URLs above as URLs it has searched.
Case Builder URLs issue
The root of my case builder URLs have also stopped working.
The case_builder
app has been up and running for some weeks. When this issue arose, I’m not sure, but it must have been recently.
- /api/v1/case-builder
All other URLs do work (this list is not exhaustive), e.g.
- /api/v1/case-builder/image
- /api/v1/case-builder/create-case
- /api/v1/case-builder/case/str:case
My case_builder.urls
urlpatterns = [
path("video", VideoCreatorView.as_view(), name="video_builder"),
path("image", ImageCreatorView.as_view(), name="image_builder"),
path("audio", AudioCreatorView.as_view(), name="audio_builder"),
path("case/<str:case>", CaseBuilderEntireCaseView.as_view(), name="case_builder_entire_case"),
path("create-case", CaseReplicatorView.as_view(), name="case_builder"),
path("my-cases", AllMyCasesBuilderView.as_view(), name="all_my_cases_case_builder"),
path(
"my-cases/<str:name>",
MyCasesByGroupBuilderView.as_view(),
name="cases_by_group_case_builder",
),
path("", include(router.urls)),
path("<str:case>", CaseBuilderEntireCaseView.as_view(), name="case_builder_entire_case1"),
]
One thing to note is that I am using DRF and in my config.url
and my case_builder.urls
there are some URLs using the DRF SimpleRouter
. These are working just fine.
At this stage I am completely at a loss as to what the issue is. I’m hoping a clever clogs with fresh eyes might be able to identify the issue.