Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

218
Views
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'

over 4 years ago · Santiago Trujillo
1 answers
Answer question

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/

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!