I defined a blueprint route like this:
@mod_patient_directory.route('/delete-patient/<string:doc_id>', methods = ['GET'])
def delete_record(self, doc_id):
mongo.db.patient.remove({'_id': doc_id})
return redirect(url_for('main-page'))
And on the form I called the method that is:
<form action="{{ url_for('patient_directory.delete_record',doc_id= doc_id )}}" method="post">
<input type="hidden" name="docId" id="docId" value="{{ patient_doc._id }}" />
<input type="hidden" name="action" id="action" value="delete" />
<button type="submit" class="btn btn-default btn-sm">
<span class="glyphicon glyphicon-remove"></span>
</button>
</form>
Can anybody tell me why I'm getting a 404 error?