Home > Software design >  Reverse for 'Project' with arguments '('',)' not found. 1 pattern(s) t
Reverse for 'Project' with arguments '('',)' not found. 1 pattern(s) t

Time:12-27

I got this error This the view of my projectThis is the url of my projectThis is the templates of my second view functionThis is the template of my first view functionThis the model of my project

I tried to render the the data in my first view linked template but the second template data does not render in my page . I want to render the data of my second template in my first template through url

CodePudding user response:

You need to correct in HTML

put {% url 'Project' project.id %} insted of {% url 'Project' Project.id %}

{% for project in projects %}
  <tr>
    <td>{{project.id}}</td>
    <td>{{project.title}}</td>
    <td>{{project.vote_ratio}}</td>
    <td>{{project.created}}</td>
    <td><a href="{% url 'Project' project.id %}"></a></td>
  </tr>
{% endfor %}

views.py

def Project(request,id):
    projectObj= project.objects.get(id=id)
    return render(request,'user/single-project.html',{'projectObj':projectObj})

urls.py

path('Project/<uuid:id>/',views.Project,name='Project'),
  • Related