Home > Software design >  I am currently using django 4.0 getting this error while including ('rest_auth.urls')
I am currently using django 4.0 getting this error while including ('rest_auth.urls')

Time:09-22

from django.contrib import admin
from django.urls import path,include
from Users.urls import * 
from django.contrib import admin

urlpatterns = [
    path('admin/', admin.site.urls),
    path("",include("Users.urls")),
    path('api/v1/rest-auth/', include('rest_auth.urls')),

    ]

Error:-ImportError: cannot import name 'url' from 'django.conf.urls'

CodePudding user response:

In rest_auth.urls do this:

from rest_framework.routers import DefaultRouter

router = DefaultRouter()
app_name = 'recipe'

urlpatterns = [
    path('',include(router.urls)),
]

Hope your problem will solve now.

  • Related