Skip to content Skip to sidebar Skip to footer

Django Form Not Being Submitted

I have a Django model/view/form that is rendering correctly in the template, but it is not submitting the data that is input to the database. Any help with this would be greatly a

Solution 1:

I tried your code. Your problem is that the action attribute of your html form tag is set to "/league/".

Unless reqPage url is actually "/league/", it won't work. When i changed action="/league/" to action="" as such:

<HTML lang="en">
<head>
    <title>User Registration</title>
</head>
<body>

    <form method="POST" action="">
        {% csrf_token %} 
        <table>{{ form }}</table>
        <input type="submit" value="Create Account"  />
    </form><br /><br />

</body>
</HTML>

The form did work:

In [3]: UserRegistration.objects.all()
Out[3]: [<UserRegistration: aoeu oeu oeu@aeou.com>]

Post a Comment for "Django Form Not Being Submitted"