Can anyone help me with this issue? I saw all posts which are similar to my issue, but I can't fix this up. Error:
Reverse for 'commit_add' with arguments '('',)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['git/project/(?P<pk>[0-9]+)/add_commit/$']
views.py
class CommitCreate(CreateView):
    template_name = 'layout/project_commit_detail.html'
    model = Commit
    fields = ['user', 'project', 'branch', 'commit_title', 'commit_body']
    success_url = reverse_lazy('git_project:index')
html form
<div class="container-fluid">
<a href="#demo1" class="btn btn-info btn-block" data-toggle="collapse">Add New Commit</a>
<div id="demo1" class="collapse" >
    <form class="form-horizontal" action="{% url 'git_project:commit_add' project.id %}" method="post" enctype="multipart/form-data">
        {% csrf_token %}
        {% if user.is_authenticated %}
        <label for="user">Commit created by: "{{ user.username }}"</label><br>
        <input id="user" type="hidden" name="user" value="{{ user.id }}">
        <label for="project">Commit for project: "{{ project.proj_title }}"</label><br>
        <input id="project" type="hidden" name="project" value="{{ project.id }}">
        <label for="branch">Branch: </label>
        <select>
            {% for branch in all_branches %}
            <option id="branch" name="branch">{{branch.branch_name}}</option>
            {% endfor %}
        </select><br>
        <label for="commit_title">Commit Title: </label>
        <input id="commit_title" type="text" name="commit_title"><br>
        <textarea id="commit_body" name="commit_body" rows="5" cols="50" placeholder="Commit body..."></textarea><br>
        <button type="submit" class="btn btn-success">Commit</button>
        {% endif %}
    </form>
</div>
url.py
url(r'project/(?P<pk>[0-9]+)/add_commit/$', views.CommitCreate.as_view(), name='commit_add'),
model.py
class Commit(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE, default=0)
    project = models.ForeignKey(Project, on_delete=models.CASCADE, default=0)
    branch = models.ForeignKey(Branch, on_delete=models.CASCADE, default=0)
    commit_title = models.CharField(max_length=64)
    commit_body = models.CharField(max_length=16384)
    commit_date = models.DateTimeField(default=timezone.now)
I don't know why is happening. Can anyone help me? I am very new in Django. Thanks! :)
 
    