Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

288
Visualizações
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 Respostas
Responde à pergunta

0

Answer for the question:

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

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda