Change query string to allow for multiple values

I have an issue with my query string, the problem is when multiple values are selected my Django search breaks. I get this in the URL ?Query=value1&Query=Value2 . In this scenario, it’s only the last value that is searched. What I want to happen is that both values are searched (with the equivalent of an AND operator in-between).

This is the desired result ?Query=value1+Value2 .

I’ve added my search form that uses Select2 and my Django search view below. If you need anything else let me now.

Any help would be much appreciated.

Search form on the front end

Front end code:

<form id="makeitso" role="search" action="" method="get">                   
            <select class="js-example-placeholder-multiple" name="query" multiple="multiple">
                <option value="Value 1">Value 1</option>   
                <option value="Value 2">Value 2</option>   
                <option value="Value 3">Value 3</option>     

                       placeholder: "Search here",

       <div class="form-inline justify-content-center">
           <button type="submit"  class="btn btn-xlarge">Search</button>

def search(request):
        search_query = request.GET.get('query', None)
        page = request.GET.get('page', 1)

        # Search
        if search_query:
            search_results =
            query = Query.get(search_query)

            # Record hit
        search_results = TestPage.objects.none()

    # Pagination
    paginator = Paginator(search_results, 3)
        search_results =
    except PageNotAnInteger:
        search_results =
    except EmptyPage:
        search_results =

    return render(request, 'search/search.html', {
        'search_query': search_query,
        'search_results': search_results,

This is not an issue with Select2, but rather with how the browser structures a GET request that has multiple query parameters with the same name. I am not familiar with Python, but I googled “request.get.get”, and the following Stack Overflow article seems to answer your question: