• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

240
Vistas
DRF - from django.conf.urls import url in Django 4.0

I've a project in django 3.2 and I've updated (pip install -r requirements.txt) to version 4.0 (new release) and I've currently the below error when I run the server in a virtual environment. I use DRF.

Can't import => from rest_framework import routers in urls.py

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

about 3 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

As per the Django docs here:

url(regex, view, kwargs=None, name=None)¶ This function is an alias to django.urls.re_path().

Deprecated since version 3.1: Alias of django.urls.re_path() for backwards compatibility.

django.conf.urls.url() was deprecated since Django 3.1, and as per the release notes here, is removed in Django 4.0+.

You can resolve the issue using path or re_path.

https://docs.djangoproject.com/en/4.0/ref/urls/

about 3 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda