geodesign / django-raster

Django-raster allows you to create tiled map services (TMS) and raster map algebra end points for web maps. It is Python-based, and requires GeoDjango with a PostGIS backend.
BSD 3-Clause "New" or "Revised" License
96 stars 39 forks source link

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

Open banesullivan opened 2 years ago

banesullivan commented 2 years ago

It seems this line:

https://github.com/geodesign/django-raster/blob/34fffe3d1f921b2850d3cad598a3c9b382e1fec7/raster/urls.py#L1

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 commented 1 year ago

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

banesullivan commented 1 year ago

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

amserra commented 11 months ago

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.