#34471 closed Bug (invalid)
Cannot import name 'url' from 'django.conf.urls'
Reported by: | VJ Magar | Owned by: | VJ Magar |
---|---|---|---|
Component: | Uncategorized | Version: | 4.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
After creating new Django app using django-admin startproject
when trying to run the project, we are getting import error for the URL.
Change History (3)
comment:1 by , 20 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
follow-up: 3 comment:2 by , 20 months ago
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
Summary: | ImportError: cannot import name 'url' from 'django.conf.urls' → Cannot import name 'url' from 'django.conf.urls' |
comment:3 by , 20 months ago
Replying to Mariusz Felisiak:
The
django.conf.urls.url
alias was deprecated in Django 3.1 and removed in Django 4.0.
Hey Mariusz Felisiak,
I knew that django.conf.urls.url
was removed in Django 4.0. However, I was getting this error when setup the new django project.
It turns out that I had accidentally used older version of Django (some old django from global space).
Thanks for quickly marking this issue as invalid. It saved few hours of mine
The
django.conf.urls.url
alias was deprecated in Django 3.1 and removed in Django 4.0.