Hello! Actually saveBUser should be a url mapped to a function on views.py
Here's an article that might help you http://docs.djangoproject.com/en/dev/topics/http/urls/?from=olddocs On Nov 24, 9:52 am, yinDojo <[EMAIL PROTECTED]> wrote: > Hello, > > I get the below error after i click on the submit button. I am trying > to save data from an input box to the datastore. the line <form > action="/saveBUser" method="post">, saveBUser should be a function in > the vews.py correct? I have the feeling i am not giving this the > correct path. > > I have included urls.py, views.py, step1_form.html, and forms.py. Any > suggestion will be appreciated. Thank you. > > # -------- error that is coming back > ----------------------------------- > Using the URLconf defined in urls, Django tried these URL patterns, in > this order: > > 1. ^admin/ > 2. ^mytest$ > > The current URL, /saveBUser, didn't match any of these. > > #------------------------------------------------------- > My urls.py one directory above my app. is : > > from django.conf.urls.defaults import * > > urlpatterns = patterns('', > # Example: > # (r'^foo/', include('foo.urls')), > > # Uncomment this for admin: > (r'^admin/', include('django.contrib.admin.urls')), > > (r'^mytest$', include('mytest.urls')), > > ) > > #----------------------------------------------------------------------------------------- > My urls.py at the app level is: > > from django.conf.urls.defaults import * > > urlpatterns = patterns('mytest.views', > #(r'^$', 'mytest.views.index'), > #(r'^views$', 'mytest.views.saveBusinessUser'), > (r'^$', 'index'), > (r'^saveBUser$', 'mytest.views.saveBUser'), > ) > > #-------------------------------------------------------- > #My step1_form.html is: > > <body class="tAdvReg"> > > {% if posts %} > {% for saveBUser in posts %} > {% if saveBUser.firstName %} > <em>{{ saveBUser.firstName.nickname }}</em> wrote:<br/> > {% else %} > <em>An anonymous person</em> wrote:<br/> > {% endif %} > {{ saveBUser.firstName }}<br/><br/> > {% endfor %} > {% endif %} > > <form action="/saveBUser" method="post"> > <table> > {{ form.as_table }} > </table> > <div><input type="submit" value="Account Registration"></div> > </form> > > </body> > </html> > > #--------------------------------- > #My views.py is: > > def index(request): > query = BusinessUser.gql('ORDER BY date DESC') > form = AcctRegistration() > return render_to_response('step1_form.html', > {'posts': query.fetch(20), > 'form': form > } > ) > > def saveBUser(request): > form = AcctRegistration(request.POST) > if form.is_valid(): > saveBUser = BusinessUser(firstName=form.clean_data['firstName']) > > if users.GetCurrentUser(): > saveBUser.firstName = BusinessUser(firstName=form.clean_data > ['firstName']) > saveBUser.firstName = users.GetCurrentUser() > > saveBUser.put() > > # --------------- forms.py ------------- > > from django import newforms as forms > > class AcctRegistration(forms.Form): > firstName=forms.CharField(label='First Name') --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---