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

151
Visualizações
Django named URL parameters no longer working after upgrade to 1.10 or 1.11

I have an old Django app which uses the URL template tag this way:

{% url 'smart_service.views.view_name' %}

So far it worked greatly, but after the update to version 1.10 nothing works anymore and any use made that way returns NoReverseMatch.

I can solve this problem by putting app_name = 'smart_service' into my urls.py file and by changing the url tag to this:

{% url 'smart_service:view_name' %}

This is a tedious task and very prone to errors, I'd like to avoid it unless strictly necessary.

Is the first use-case been deprecated? If not, why isn't it working anymore? Are there specific advantages in using one or the other?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can't avoid this change when you upgrade to Django 1.10+.

Support for reversing urls using the dotted Python path was deprecated in Django 1.8 and removed in 1.10.

You must change your {% url %} tags to use the view name, e.g.

{% url 'view_name' %}

If you add a namespace to your urls.py, for example app_name = 'smart_service', then you must include the namespace in the {% url %} tag.

{% url 'smart_service:view_name' %}
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