[Django] #35579: Run the development server (python manage.py runserver) creating http://127.0.0.1:8000/login/ in your browser.

0 views
Skip to first unread message

Django

unread,
1:50 PM (5 hours ago) 1:50 PM
to django-...@googlegroups.com
#35579: Run the development server (python manage.py runserver) creating
http://127.0.0.1:8000/login/ in your browser.
--------------------------+-----------------------------------------
Reporter: clay1969 | Type: Uncategorized
Status: new | Component: Uncategorized
Version: 5.0 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------+-----------------------------------------
Potential Bug Report for Django (4.2.13)
Title: Unexpected "Page not found (404)" error for "/login/" path even
without login functionality enabled.

Description:

This bug report describes an issue where Django (version 4.2.13) throws a
"Page not found (404)" error for the path "/login/" even when the project
doesn't utilize Django's built-in login functionality. The mysite/urls.py
file does not define a URL pattern for login, yet the error persists.

Steps to Reproduce:

Create a new Django project (using django-admin startproject mysite).

In mysite/settings.py, ensure there are no configurations related to login
functionality (e.g., no LOGIN_URL setting).

In mysite/urls.py, define only URL patterns for desired functionalities
(excluding login). For example:

Python
from django.contrib import admin
from django.urls import path

urlpatterns = [
path("admin/", admin.site.urls),
# Other URL patterns for your app views
]
Use code with caution.
content_copy
Run the development server (python manage.py runserver).

Access the URL http://127.0.0.1:8000/login/ in your browser.

Expected Behavior:

Django should not generate a "Page not found" error for "/login/" as the
project doesn't have a login URL pattern defined.
Actual Behavior:

Django displays a "Page not found (404)" error for "/login/".
Additional Information:

Python version: [Mention your Python version]
Operating System: macOS
Django version: 4.2.13
Possible Causes (for investigation):

Conflicting URL patterns in other apps (if applicable).
Third-party app interference with URL resolution.
Unexpected behavior in core Django routing logic (less likely).
Severity:

Medium (Disrupts development workflow and might cause confusion for users
encountering the error).

Workaround (if applicable):

Manually remove any login URL patterns defined in other app-specific
urls.py files.
Request:

Investigate the cause of the unexpected "Page not found" error for
"/login/" when login functionality is not explicitly used.
Provide a potential fix or workaround if this is a bug in Django's core
behavior.
Please note: This is a potential bug report based on the information
provided. You might need to modify it based on your specific project setup
and any additional details you discover.




tune

share


more_vert
--
Ticket URL: <https://code.djangoproject.com/ticket/35579>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
2:06 PM (4 hours ago) 2:06 PM
to django-...@googlegroups.com
#35579: Run the development server (python manage.py runserver) creating
http://127.0.0.1:8000/login/ in your browser.
-------------------------------+--------------------------------------
Reporter: clay richmond | Owner: (none)
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Natalia Bidart):

* resolution: => invalid
* status: new => closed

Comment:

Hello Clay, thanks for your report. If I understand your description
correctly, you are saying that:

1. You have a Django project that does not define nor implement login in
any way, and
2. You are running the development server, and
3. You are accessing an URL that your project does not implement
('/login/') and you get a 404

If the above is correct, then this is the expected behavior. Django will
respond with a 404 for URLs that your project does not implement.

When you say:

> Django should not generate a "Page not found" error for "/login/" as the
project doesn't have a login URL pattern defined.

What do you expect to happen instead?

With the information provided so far, I think this report seems better
suited to be a support request. The best place to get answers to your
issue is using any of the user support channels from
[https://docs.djangoproject.com/en/dev/faq/help/#how-do-i-do-x-why-
doesn-t-y-work-where-can-i-go-to-get-help this link].

Since the goal of this issue tracker is to track issues about Django
itself, and your issue seems, at first, to be located in your custom code,
I'll be closing this ticket as invalid following the
[https://docs.djangoproject.com/en/dev/internals/contributing/triaging-
tickets/#closing-tickets ticket triaging process].
--
Ticket URL: <https://code.djangoproject.com/ticket/35579#comment:1>
Reply all
Reply to author
Forward
0 new messages