Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 4.0+: ImportError: cannot import name 'url' from 'django.conf.urls' #71

Open
banesullivan opened this issue Jun 14, 2022 · 3 comments

Comments

@banesullivan
Copy link

It seems this line:

from django.conf.urls import url

Is giving an error:

#20 1.022   File "/usr/local/lib/python3.9/site-packages/raster/urls.py", line 1, in <module>
#20 1.022     from django.conf.urls import url
#20 1.022 ImportError: cannot import name 'url' from 'django.conf.urls' (/usr/local/lib/python3.9/site-packages/django/conf/urls/__init__.py)
------

and needs to be changed to support Django 4.0+ as django.conf.urls.url() was deprecated in Django 3.0, and is removed in Django 4.0+.

I believe a simple fix is to replace this with from django.urls import re_path as url

@amserra
Copy link

amserra commented Jun 22, 2023

One year after this issue was reported this is still relevant.

@banesullivan
Copy link
Author

@amserra, this project hasn't been maintained in 2+ years

@amserra
Copy link

amserra commented Oct 10, 2023

For future readers, I have forked this repository and made the necessary changes for it to support Django version 4 and up. You can find it here: https://github.com/amserra/django-raster4

Note that I do not intend to build new features, just support the new Django version(s) for as long as I need the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants