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

562
Views
Cómo acceder a Django UpdateView usando un uuid como slug

Me pregunto cómo puedo acceder a UpdateView usando un uuid como slug. Así que mi objetivo es una URL como

http://myapp.example.de/edit/7efdbb03-bdcf-4b8a-85dd-eb96ac9954fd

He definido la vista así:

 class DeviceEventUploadView(UpdateView): model = Event slug_url_kwarg = 'uuid_slug' slug_field = 'unique_id'

y urls.py así:

 urlpatterns = [ path('admin/', admin.site.urls), path('edit/<uuid:uuid_slug>', DeviceEventUploadView.as_view(), name='event_update'), ]

Aquí estoy recibiendo:

 Using the URLconf defined in myproject.urls, Django tried these URL patterns, in this order: admin/ ^edit/<uuid:uuid_slug> [name='event_update'] The current path, edit/7efdbb03-bdcf-4b8a-85dd-eb96ac9954fd/, didn't match any of these.

¿Dónde está mi fracaso al pensar?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Olvidaste cerrar <uuid:uuid_slug> . Necesita un paréntesis angular de cierre > . Además, esta es la sintaxis de path . Por lo tanto, define esto con:

 path ( 'edit/ <uuid:uuid_slug> /', DeviceEventUploadView.as_view(), name='event_update' ),
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!