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

283
Views
How to pass slug value to a template?

I am able to access username1/editin the URL but not able to do so by clicking a link in the template.

urls.py

url(r'^(?P<slug>[-\w\d]+)/edit/$', ProfileEdit.as_view(), name='profile_edit'),

template.html

<a href="{% url 'profile:profile_edit' %}">edit</a>

i get the following error

Reverse for 'profile_edit' with arguments '()' and keyword arguments '{}' not found. 1 pattern(s) tried: ['(?P[-\w\d]+)/edit/$']

i get the problem is not sending the slug value to the url. but how to send the slug value from a template?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Answer for the question:

<a href="{% url 'profile:profile_edit' slug=profile.slug %}">Edit</a>

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!