social-docs icon indicating copy to clipboard operation
social-docs copied to clipboard

Django configuration sample uses `django.conf.urls.url()`, which was removed in Django 4.0

Open garcia opened this issue 1 year ago • 0 comments

https://python-social-auth.readthedocs.io/en/latest/configuration/django.html#urls-entries

urlpatterns = patterns('',
    ...
    url('', include('social_django.urls', namespace='social'))
    ...
)

The url() function was removed in Django's 4.0 release. Old documentation states it was an alias for django.urls.re_path(), but the empty string route doesn't require regex, so django.urls.path() would suffice here:

  urlpatterns = patterns('',
      ...
-     url('', include('social_django.urls', namespace='social'))
+     path('', include('social_django.urls', namespace='social'))
      ...
  )

garcia avatar Jan 21 '24 21:01 garcia