Redirecting to wrong pages in Django

I have a problem in Django where my pages are redirecting to wrong pages. It just somehow happen to the new page I am coding which I have no idea why.

urls.py

path('job/', JobListView.as_view(), name = 'jobs'),
path('job/edit/<int:pk>/', views.job_edit, name='job-edit'),
path('device_add/', views.device_add, name='device-add'),

views.py

class JobListView(ListView):
    model = Job
    template_name = 'interface/job.html' #<app>/<model>_<viewtype>.html
    context_object_name = 'jobs'
    ordering = ['date_added']

def job_edit(request, pk):
    job = Job.objects.get(pk=pk)
    #if request.method =="POST":

    return render(request, 'interface/job_edit.html',{'job': job})

My html for my job_edit has the following:

<div class="row">
 <div class="col-md-12">
  <div class="text-sm-right">
   <button class="btn btn-outline-secondary" type="submit">Save</button>
   <a href="{% url 'jobs' %}">
    <button class="btn btn-outline-secondary"> Back</button>
   </a>
  </div>
 </div>
</div>

As stated in my urls.py, the url is job/ and name = jobs, which I want the back button to redirect back to job/. But whenever i pressed the back button, it somehow redirect back to device_add/. Same goes for my save button. As in my views, I have not coded the if part for request.method=='POST'. But when i attempt to press the save button, it redirect to device_add/. Can anyone explain what I am doing wrong?

I guess that is because your button is inside a form element? So it takes precedence and it is evaluated as form submit?

Can you try removing the button tag and just use the a with tags you currently have on the button?

Hi, thanks for the quick reply. I tried with just the a tags it worked. I also tried shifting this 2 buttons, save and back button outside of the form element, it also worked. Thanks!