I'm trying to POST data from a form in Django and when I click submit it doesn't get into the POST. I've already done a few POSTs using Django and they are working fine. Here, the first time the template is rendered it gets into the NO POST, which is correct. But then, when submitting the form it says NOT VALID.

*urls.py*

```
url(r'^traps/view/', 'servicios.views.viewtraps'),

```

*forms.py*

```
class LimitQueryForm(forms.Form):

    limit = forms.CharField(label='Nº de Resultados a Mostrar', max_length=250)

```

*template*

```
<form action="/services/traps/view/" method="post">{% csrf_token %}
    {{ form_limit }}   
    <button type="submit" value="btn_limit_val" name="btn_limit_name">Aceptar</button>    
</form> 

```

*views.py*

```
def viewtraps(request):

    connect_mysql = mdb.connect(*)
    cursorMYSQL = connect_mysql.cursor(mdb.cursors.DictCursor)
    cursorMYSQL.execute("""select eventname,eventid,trapoid,enterprise,community,hostname,agentip,category,severity,uptime,traptime,formatline,timestamp from snmptt order by id desc limit 500""")
    b = cursorMYSQL.fetchall()
    connect_mysql.close()

    form_limit = LimitQueryForm()

    if request.method == 'POST':

        if form_limit.is_valid():

            limit = "VALID"

            dictionary = RequestContext(request, {"buffer_data": b, "form_limit": form_limit, "limit": limit})
            return render_to_response("viewtraps.html", dictionary)

        else:

            limit = "NOT VALID"

            dictionary = RequestContext(request, {"buffer_data": b, "form_limit": form_limit, "limit": limit})
            return render_to_response("viewtraps.html", dictionary)

    else:   

        limit = "NO POST"

        dictionary = RequestContext(request, {"buffer_data": b, "form_limit": form_limit, "limit": limit})
        return render_to_response("viewtraps.html", dictionary)

```

I know some users are telling me that I shouldn't use django this way, there are reasons why I'm doing it this way, please avoid commenting on that as it's not the issue right now. Thanks!