Page Not Found or 404, basically doesn't have any relation with template of
form.

Just check if you have the URL that you are trying to hit in urls.py, as 404
happens when the URL you are trying to access is not configured or not
available on your webapp.

Regards
//Vikalp

On Tue, Jun 14, 2011 at 3:43 PM, Satyajit Sarangi <writetosatya...@gmail.com
> wrote:

> My forms.py is this
>
>
> from django import forms
> from django.forms.widgets import RadioSelect
> import floppyforms as forms
> class PermForm(forms.Form):
>    user = forms.CharField(max_length=100)
>    RADIO_CHOICES1 = [['1','Radio 1'],['2','Radio 2']]
>    RADIO_CHOICES2 = [['3','Radio 2'],['4','Radio 2']]
>    radio = forms.ChoiceField( widget=RadioSelect(),
> choices=RADIO_CHOICES1)
>    radio = forms.ChoiceField( widget=RadioSelect(),
> choices=RADIO_CHOICES2)
>
>
> My views.py is this
>
> from django.conf import settings
> from django.shortcuts import render_to_response
> from django.template import RequestContext, loader
> from django import forms
> from django.core import validators
> from django.contrib.auth.models import User
> from django.utils import simplejson
>
> def PermLayer(request):
>        users = User.objects.all()
>        if request.method == 'POST':
>                form = PermForm(request.POST)
>                if form.is_valid():
>                        data = form.cleaned_data
>                        rad1=form.cleaned_data['RADIO_CHOICES1']
>                        rad2=form.cleaned_data['RADIO_CHOICES2']
>                        User.objects.get(username = data['username'])
>                        print rad1
>                        perm = Permission()
>                        perm.user = User.objects.get('pk')
>                        perm.table =
> ContentType.objects.get_for_model(TableToAddPermissionFor)
>                        perm.permi = rad1 + rad2
>                        perm.save()
>                        return
> render_to_response('permission.html',{'user':users})
>                else:
>                        form = PermForm()
>
>
>
>        return render_to_response('permission.html', {'user':users})
>
>
> My template is this
>
>
>
>
>
>
>
> <html>
> <head>
> <title>Permissions</title>
>
> </head>
>
> <p>These are the present users {{user}} </p>
>
>
>
>
> <body>
> <form name="myform" action="." method="POST">
> <div align="center"><br>
>
> <tr><th>User:</th><td><input type="text" name="user" maxlength="100" /
> ></td></tr>
>
> <label>
> </br></br>
> Who can view the data </br>
> <p>
> <input type="radio" name="radio" value="1" />Any registered users</
> label></li>
> <label><input type="radio" name="radio" value="2" /> Only users that
> can edit</label></li>
> </p>
> Who can edit the data </br>
> <p>
> <label><input type="radio" name="radio1" value="3" />Any registered
> user</label></li>
> <label><input type="radio" name="radio1" value="4" /> Only the
> following users</label></li>
> </p>
> <p>
> <input type="submit" value="Submit" />
> </p>
> </div>
> </body>
> </html>
>
>
> When I click on the submit button . it shows an error showing that
> page not found PermForm 404 .
>
> How to debug ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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

Reply via email to