request.POST.get() showing a None when print is used
<p>Like the question said, when I print, it shows the list/string first then a "None" in the end just like this:</p>

<pre><code>["a","b","c"]
"test"
None
None
</code></pre>

<p><em>script</em></p>

<pre><code>$(document).ready(function() {
            $("#export").click(function () {
              var test = "test";
              var array1 = ['a','b','c'];
              $.ajax({
                url: '/export/csv',
                data: {'array1': JSON.stringify(array1), 'test': JSON.stringify(test)},
                dataType: 'json',
                type: 'POST',
                success: function (data) {
                }
              });
            });
        });
</code></pre>

<p><em>views.py</em></p>

<pre><code>@csrf_exempt
def export_csv(request):

    print(request.method)
    test1 = request.POST.get('test')
    array1 = request.POST.get('array1')

    response = HttpResponse(content_type='text/csv')
    response['Content-Disposition'] = 'attachment; filename="product-inventory.csv"'

    print(array1)
    print(test1)

    writer = csv.writer(response)
    writer.writerow(['Test1')

    for t in array1:
        writer.writerow([t])

    return response
</code></pre>

<p><em>urls.py</em></p>

<pre><code>url(r'^export/csv$', product_views.export_csv, name='export_csv')
</code></pre>

<p>I know I'm missing something in my <em>views.py</em>. If you could point me to the right direction, that would be great.</p>

<p>Thanks in advance!</p>