I have a simple form:

{% extends "base.html" %}
{% block title %}Take Snapshot of Billing Reads{% endblock %}
{% block head %}Take Snapshot of Billing Read{% endblock %}

{% block content %}
    {% if user.username %}
        <br><br>
        <form action="." method="post">
            {{ form.as_p }}
        <p><label for="Section Number">Section Number:</label>
            <input id="cycle" type="text" name="cycle" maxlength="1"
size="1" /></p>
        <input type="submit" value="Snap Read" />
        </form>
    {% else %}
        <p>Please <a href="/login">log in</a>.</p>
    {% endif %}
{% endblock %}

def read_snap(request):
    if request.method == 'POST': # If the form has been submitted...
        form = ReadSnapForm(request.POST)
        if form.is_valid(): # All validation rules pass
            # Process the data in form.cleaned_data
            # ...
            return HttpResponseRedirect('/read_snap/') # Redirect
after POST
    else:
        form = ReadSnapForm() # An unbound form

    variables = RequestContext(request, {
        'form': form
    })

    return render_to_response('after_read_snap.html', variables)

But I keep getting a 403 regarding CRSF verification.

This is an internal web site, whose sophistication I intend to grow
over time, but right now, it will consist of simple forms that launch
Python programs.

What do I need to do to get around the CRSF error? I've tried using
Context instead of RequestContext, and then get the error that I need
to use RequestContext.

Thanks.
cmn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to