getting checkbox value but it returned none in django templare


please help me a bit. I'm kind of stuck for a while now. Any advice would be nice. So, I want to pass a value from a checkbox to my view. Here my template that contains the checkbox.

<form method="POST" action="{% url 'search:specs' %}">
    {% csrf_token %}
    {% for page in all_page %}
    <div class="row">
        <h1> {{ page.info }}</h1>
        <div class="well">
        {% for item in page.searchitem_set.all %}
        <div class="list-group">
        <input type="checkbox" id="items" name="compare" value="{{ item.id }}">

and this is my view

def specs(request):
compare_item = request.POST.get('compare')
print(compare_item)
#item1 = compare_item[1]
item = get_object_or_404(SearchItem, id=compare_item)

The print() command returns a None.



try :

some_var = request.POST.getlist('compare')

will give you list of values of check-boxes which are selected