Django python trying to use forms with token does not work for me
<p>I'm learning django, in this moment I'm trying to implement web forms, actually some of them  works fine with the data base model but I'm trying to make a new one without use the models. The problem is that django show me the token and not the value typed in the form.</p>

<p>I hope you can help me, to understand more about it.</p>

<p>URLS:</p>

<pre><code>url(r'^test', views.test),
</code></pre>

<p>VIEWS:</p>

<pre><code>def test(request):
    if request.method == "POST":

        return HttpResponse(request.POST)       



    return render(request, 'datos.html')
</code></pre>

<p>DATOS HTML:</p>

<pre><code>&lt;form action="/test" method="post" name="myForm"&gt; {% csrf_token %}
&lt;input type="text"&gt;
&lt;input type="submit"&gt;
&lt;/form&gt;
</code></pre>

<p>When I run this django show me:</p>

<p><strong>csrfmiddlewaretoken</strong></p>

<p>Can any one help me please?</p>

<p>To protect from <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)" rel="nofollow">Cross-Site_Request_Forgery</a> attack, for each post request we need to send a csrf token, from the form, which is missing in your form, you can get rid of this error by modifying your form as follows.</p>

<pre><code>&lt;form action="/test" method="POST" name="myForm"&gt; 
     {% csrf_token %}
&lt;input type="text"&gt;
&lt;input type="submit"&gt;
&lt;/form&gt;
</code></pre>

<p>and You need to get the data from your views, </p>

<pre><code>def test(request):
    if request.method == "POST":
        # Getting the value of text field from the form
        # If the value is empty set the default value to None
        text = request.POST.get('text', None)

        # Do not return the POST request
        # Return the value you get from the form
        return HttpResponse(text)       


       # This code is not going to execute 
       # Return is already encountered above in our code 
        return render(request, 'datos.html')
       # To send data to form do, 
       # return render(request, 'datos.html', {'my_data': text})
</code></pre>

python django forms token