I'm trying to set op SmartSelect in my django project so I can chain dropdown menu's. I do not understand how/where the urls belongs for the installation?
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^chaining/', include('smart_selects.urls')),
)
This is what their official installation guide says. Though this is either and old version of Django or i'm doing something wrong as I have not seen any URLS file written this way before and VScode does not recognize it.
What am I doing wrong?
CodePudding user response:
As of django-3.1, url(…)
[Django-doc] is
deprecated in favor of re_path(…)
[Django-doc] and has been removed in django-4.0.
Furthermore a new syntax for paths has been introduced with path converters: you
use path(…)
[Django-doc] for that.
So you can implement this as:
from django.urls import include, path
urlpatterns = [
path('admin/', include(admin.site.urls)),
path('chaining/', include('smart_selects.urls')),
]
That being said, if the documentation is that old, the project might no longer be "alive".