[Django] #32870: Added message when user mispells 'urlpatterns' in some 'urls' module

10 views
Skip to first unread message

Django

unread,
Jun 21, 2021, 10:16:51 AM6/21/21
to django-...@googlegroups.com
#32870: Added message when user mispells 'urlpatterns' in some 'urls' module
-------------------------------------+-------------------------------------
Reporter: Igor | Owner: nobody
Kuivjogi Fernandes |
Type: | Status: new
Uncategorized |
Component: Core | Version: 3.2
(URLs) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I found this kind of error when I mispelled `urlspattern` instead of
`urlpatterns` inside my blog/urls.py file.
So the console was throwing an error, but this error do not helped me to
found the problem. Check it:

{{{
django.core.exceptions.ImproperlyConfigured: The included URLconf '<module
'blog.urls'
from '.../my_project/blog/urls.py'>' does not
appear to have any patterns in it. If you see valid patterns in the file
then the
issue is probably caused by a circular import.
}}}

The problem is not with a circular import, but with the mispelled
`urlpatterns` variable itself, so I'm doing this ticket.

OBS.: I have already created a pull request for this:
https://github.com/django/django/pull/14453

I appreciate any feedback.
Thanks,
Igor

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

Django

unread,
Jun 21, 2021, 10:22:37 AM6/21/21
to django-...@googlegroups.com
#32870: Added message when user mispells 'urlpatterns' in some 'urls' module
-------------------------------------+-------------------------------------
Reporter: Igor Kuivjogi | Owner: Igor
Fernandes | Kuivjogi Fernandes
Type: | Status: assigned
Cleanup/optimization |
Component: Core (URLs) | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* owner: nobody => Igor Kuivjogi Fernandes
* status: new => assigned
* has_patch: 0 => 1
* type: Uncategorized => Cleanup/optimization


Comment:

[https://github.com/django/django/pull/14453 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/32870#comment:1>

Django

unread,
Jun 21, 2021, 2:52:24 PM6/21/21
to django-...@googlegroups.com
#32870: Added message when user mispells 'urlpatterns' in some 'urls' module
-------------------------------------+-------------------------------------
Reporter: Igor Kuivjogi | Owner: Igor
Fernandes | Kuivjogi Fernandes
Type: | Status: assigned
Cleanup/optimization |
Component: Core (URLs) | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted


Comment:

Agreed, we can improve an error message.

--
Ticket URL: <https://code.djangoproject.com/ticket/32870#comment:2>

Django

unread,
Jun 22, 2021, 2:12:30 AM6/22/21
to django-...@googlegroups.com
#32870: Added message when user mispells 'urlpatterns' in some 'urls' module
-------------------------------------+-------------------------------------
Reporter: Igor Kuivjogi | Owner: Igor
Fernandes | Kuivjogi Fernandes
Type: | Status: assigned
Cleanup/optimization |
Component: Core (URLs) | Version: 3.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32870#comment:3>

Django

unread,
Jun 22, 2021, 2:50:27 AM6/22/21
to django-...@googlegroups.com
#32870: Added message when user mispells 'urlpatterns' in some 'urls' module
-------------------------------------+-------------------------------------
Reporter: Igor Kuivjogi | Owner: Igor
Fernandes | Kuivjogi Fernandes
Type: | Status: closed

Cleanup/optimization |
Component: Core (URLs) | Version: 3.2
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"e85d9c02ad1ef8988c149bad905fbc5b98a38594" e85d9c02]:
{{{
#!CommitTicketReference repository=""
revision="e85d9c02ad1ef8988c149bad905fbc5b98a38594"
Fixed #32870 -- Improved error message when URLconf is empty.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32870#comment:4>

Reply all
Reply to author
Forward
0 new messages