3,769 questions
-1 votes
1 answer
90 views
Django Registration View Not Rendering Template, Returns Minimal Response (71 Bytes)
I'm working on a Django project (version 5.2.6) and facing an issue with the student registration view. The login and logout views work perfectly, but the registration view (StudentRegistrationView) ...
3 votes
1 answer
59 views
Django same slug but using different URL path
I am making a documentation site to self-host for myself; learning Django at the same time. I am at the point where I am starting to populate the website. I am wondering if there is a possibility to ...
1 vote
1 answer
27 views
Django DRF showing weired auth methode respective to URL
I'm facing a strange issue with Django REST Framework (DRF). # views.py class CheckoutView(APIView): permission_classes = [AllowAny] def post(self, request, *args, **kwargs): ...
2 votes
3 answers
172 views
Django re_path to catch all URLs except /admin/ not working properly
I'm trying to define a re_path in Django that catches all URLs except those that start with /admin/. My goal is to redirect unknown URLs to a custom view (RedirectView), while ensuring that all admin ...
0 votes
1 answer
26 views
Django is adding slash into dynamic URL segment
I have a dynamic url configured like so: path('segment/', func1, name='func1'), path('segment/<str:string>/', string, name='string'), However, when I go to https://example.com/segment/watch?v=...
1 vote
1 answer
53 views
Redirecting from DELETE to GET in Django
Why is it that when I send a request via Postman, e.g. DELETE http://127.0.0.1:8000/api/v1/courses/3 I get a redirect to GET /api/v1/courses/3/? If I post to http://127.0.0.1:8000/api/v1/courses/3/ it ...
0 votes
1 answer
56 views
Django - Failed Login Redirecting To Different Page
I am new to Django and I am trying to use the authentication system. I have managed to get it working using the default Auth URLS. (/accounts/login) etc. I want to get a login form on my homepage so ...
2 votes
4 answers
125 views
How to make a Django `url` case insensitive?
For example, if I visit http://localhost:8000/detail/PayPal I get a Page not found error 404 with the following message: Using the URLconf ... Django tried these URL patterns, in this order: ... ...
1 vote
1 answer
28 views
Nested Routes in Django with Generic Views (not ViewSets)
All the tutorials and online resources I find teach how to build nested routes in DRF with ViewSets. How could one build nested routes in Django with generic class views? Example: I would like to have ...
0 votes
2 answers
88 views
Django,There is no module named "myapp"
enter image description here PS C:\Users\taipe\firstproject> & C:/Users/taipe/AppData/Local/Programs/Python/Python312/python.exe c:/Users/taipe/firstproject/firstproject/urls.py Traceback (most ...
1 vote
1 answer
62 views
Django Custom Dynamic urlpatterns
I'm working on a django project and in this project I have two subprojects. So in this case what I want to do is store domains and assign services (my subprojects) to these domains. For example, let's ...
0 votes
1 answer
41 views
can I use the slug from a different urls.py file?
I'm trying to access a slug field from a different urls.py file, and I'm getting this error FieldError at /new-api/tournaments/fifa-world-cup/teams/ Unsupported lookup 'custom_url' for ForeignKey or ...
0 votes
0 answers
43 views
Django tried these URL patterns, in this order http://127.0.0.1:8000/api/ifconfig/
I have a problem with urls in my project, I can't understand why I getting error: Request Method:GET Request URL:http://127.0.0.1:8000/api/ifconfig/ Using the URLconf defined in commands.urls, Django ...
0 votes
1 answer
61 views
How do I correctly define the url in Django (error Page not found (404))
I am learning Django, and building the following project: My project is es. I have 3 apps called event, items_dashboard and item. Each event has one items_dashboard, and zero or more items. When the ...
1 vote
1 answer
64 views
extending django admin by a view without a model
I have a customized admin view - my app is called virtual: class VirtualAdminSite(admin.AdminSite): index_template = "virtual/admin_index.html" def index(self, request, ...