Display uploaded/chosen image without saving it in database in Django
<p>I'd like to store the image which the user uploads, in a variable within views.py (and apply some opencv operations on it) and then display the resultant image. <strong>I don't want to store the image in a database</strong>. So, i don't think models are necessary for implementing this. How to proceed further? Following are the <code>index.html</code> and <code>views.py</code>. Sorry if any coding mistakes are there, i'm new to Django.</p>

<p><strong>index.html</strong></p>

<pre><code>&lt;form method="POST" enctype="multipart/form-data"&gt;{% csrf_token %}
    &lt;div class="file-field input-field left"&gt;
        &lt;div class="btn black-text waves-effect waves-dark" style="background-color: #F5DF73"&gt;
            &lt;div&gt;Upload&lt;/div&gt;
            &lt;input type="file" name = "input_image" onchange="readURL(this);"&gt;
        &lt;/div&gt;
        &lt;div class="file-path-wrapper"&gt;
           {#&lt;input class="file-path validate" type="text"&gt;#}
        &lt;/div&gt;
    &lt;/div&gt;
    {{ image }}
&lt;/form&gt;
</code></pre>

<p><strong>views.py</strong></p>

<pre><code>def upload_pic(request):

    if request.method == 'POST':
        form = ImageUploadForm(request.POST, request.FILES)
        image = form.cleaned_data['image']

    return render(request, 'html/index.html', {"image": image})
</code></pre>

<p><strong>urls.py</strong></p>

<pre><code>urlpatterns = [
    url(r'^$', views.index),
]
</code></pre>