below is also the file for the registration form

def register_page(request):
    if request.method=="POST":
        if form.is_valid():
            return HttpResponseRedirect('/')
    variables=RequestContext(request,{'form':form })
    return render_to_response(
        'registration/register.html', variables

On Saturday, September 17, 2016 at 9:02:52 AM UTC+1, Timothy Steele wrote:
> first i created a Login form and an error message show as  *CSRF token 
> missing or incorrect.*
> I was able to work it out by adding* {% csrf_token %}* int the login form 
> and adding the import file in the views as from *django.template import 
> Context,RequestContext.*
> But when i created a registration form the same problem came and i  submit 
> the form, i added the {% csrf_token %} file in the registration form but 
> it did not work. 
> the code are shown below
> {% extends "base.html" %}
> {% block title %}User Registration{% endblock %}
> {% block head %}User Registration{% endblock %}
> {% block content %}
> <form method="post" action=".">
>     {% csrf_token %}{{ form.as_p }}
>     <input type="submit" value="register" />
> </form>
> {% endblock %}

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

Reply via email to