NoReverseMatch at /perfis/5 Reverse for 'convite' with arguments '('',)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['perfis/(?P\d+)/convite$'] Request Method: GET Request URL: http://localhost:8000/perfis/5 Django Version: 1.10.1 Exception Type: NoReverseMatch Exception Value:Reverse for 'convite' with arguments '('',)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['perfis/(?P\d+)/convite$'] Exception Location: /Applications/anaconda/lib/python3.5/site-packages/django/urls/resolvers.py in _reverse_with_prefix, line 392 Python Executable: /Applications/anaconda/bin/python Python Version: 3.5.2 Python Path:['/Users/lucianecarvalho/Documents/treinamentos/Alura/python/Django/connectedin', '/Applications/anaconda/lib/python35.zip', '/Applications/anaconda/lib/python3.5', '/Applications/anaconda/lib/python3.5/plat-darwin', '/Applications/anaconda/lib/python3.5/lib-dynload', '/Applications/anaconda/lib/python3.5/site-packages/Sphinx-1.4.1-py3.5.egg', '/Applications/anaconda/lib/python3.5/site-packages/setuptools-23.0.0-py3.5.egg', '/Applications/anaconda/lib/python3.5/site-packages', '/Applications/anaconda/lib/python3.5/site-packages/aeosa'] Server time: Tue, 4 Oct 2016 17:27:51 +0000
Arquivo url (app) urlpatterns =[ url(r'^$', views.index, name='index' ), url(r'^perfis/(?P\d+)$', views.exibir, name='exibir'), url(r'^perfis/(?P\d+)/convite$', views.convite, name='convite') ] Arquivo perfil.html <!DOCTYPE html>
Detalhe Perfil: {{pf.nome|upper}}
convidarFunção de View def convite(request, perfil_id): perfil_a_convidar = Perfil.objects.get(id=perfil_id) perfil_logado = get_perfil_logado(request) perfil_logado.convidar(perfil_a_convidar) return redirect('index')
P.S se eu tiro essa linha no arquivo perfil ( convidar) a pagina carrega, mas quando coloco a função de view dá esse erro e não consigo resolver.