Opened 4 years ago
Closed 4 years ago
#32870 closed Cleanup/optimization (fixed)
Added message when user mispells 'urlpatterns' in some 'urls' module
Reported by: | Igor Kuivjogi Fernandes | Owned by: | Igor Kuivjogi Fernandes |
---|---|---|---|
Component: | Core (URLs) | Version: | 3.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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
Change History (4)
comment:1 by , 4 years ago
Has patch: | set |
---|---|
Owner: | changed from | to
Status: | new → assigned |
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 4 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Agreed, we can improve an error message.
comment:3 by , 4 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
PR