Project Matching Query Does Not Exist Error?

后端 未结 1 1043
孤街浪徒
孤街浪徒 2021-01-22 18:16

This is the view:

def showProject(request, project_slug):
project = Project.objects.get(slug=project_slug)
tickets = Ticket.objects.filter(project=project)
paylo         


        
1条回答
  •  爱一瞬间的悲伤
    2021-01-22 18:45

    project = Project.objects.get(slug=project_slug)
    

    is raising an exception (DoesNotExist), meaning that there is no project in the Project table with a slug corresponding to the value in project_slug

    The regex in your urls might be wrong, the link sending you to showProject view might be wrong or there mightn't be a project in the table yet corresponding to that slug

    0 讨论(0)
提交回复
热议问题