Thanks for replying Bill :D Ooops !! i removed the question mark but it is till not working !! The problem is that i dont have a form and i think form maynot be suitable to for application !!
MY requirements :- i have some list of items and clicking on any of it should go to the view and tell me which item was clicked i.e. These are the items which are to be clicked * h...@hp.com *a...@gmail.com *x...@gmail.com Now if user clicks a...@gmail.com My view should know that a...@gmail.com was clicked i.e. item selected (a...@gmail.com) should be passed to my view and i should be able to perform some calculation with this email !!! Any clue as to how to achieve this goal !! I thought using url regex extraction ,i will be able to pass paramters to my views like acceptfriend/a...@gmail.com/ or acceptfriend/h...@hp.com/ or acceptfriend/x...@gmail.com/ will match r'^acceptfriend/(\w+)/$' and this captured parameter ( (\w+)/) will be passed to my appropriate view !! On Wed, Apr 22, 2015 at 1:15 AM, Bill Freeman <ke1g...@gmail.com> wrote: > I think that it is the question mark in your url pattern that is causing > the problem. In a real url, question mark separates the path from the > query parameters. Parentheses in url patterns are for capturing parts of > the path, and are not associated with query parameters. Just leave out > the ? and it may just work. > > (Of course, if you also want this parameter filled in by the submission of > a form, you would be better to put the email address in a query paramater, > as a form submission would.) > > On Tue, Apr 21, 2015 at 3:25 PM, livelikehimanshu12 < > livelikehimansh...@gmail.com> wrote: > >> Hello friends , >> I am trying to send a simple parameter to view from my template . >> But i am getting the error 'Reverse for acceptfriend with arguments (' >> hpe...@hp.com',) and keyword arguments {} not found. >> Plzz help me !! I am not much comfortable with url concepts !! >> ----> i need to pass hpe...@hp.com to my view !! >> >> ###################################################### url.py >> ############################################################## >> from django.conf.urls import patterns, include, url >> from django.contrib import admin >> from django.conf import settings >> from django.conf.urls.static import static >> >> admin.autodiscover() >> >> >> urlpatterns = patterns('', >> url(r'^admin/', include(admin.site.urls)), >> >> url(r'^$', 'app.views.home',name='homeurl'), >> url(r'^signup/$','app.views.signup',name='signupurl'), >> url(r'^verifylogin/$','app.views.loginverify',name='verifyloginurl'), >> >> url(r'^verifysignup/$','app.views.signupverify',name='verifysignupurl'), >> url(r'^login/$','app.views.login',name='loginurl'), >> # url(r'^imgurl/$','app.views.imageviewer',name='imgurl'), >> url(r'^uploadpic/$','app.views.uploadpic',name='uploadpic'), >> url(r'^refreshpage/$','app.views.refreshpage',name='refreshpage'), >> url(r'^acceptfriend/?(\w+)/$', >> 'app.views.acceptfriend','acceptfriend'), >> )+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) >> >> ###################################################### profile.html (my >> template )################################################################## >> .. >> .. >> ..{% for g in list_reqfromemail %} >> <tr> >> <td> <a href="{% url >> 'acceptfriend' g %}">{{ g }} </a></td> >> >> </tr> >> {% endfor %} >> #################################################### views.py >> ################################################################################ >> def acceptfriend(request,reqfromemail): >> try: >> myemail=request.session['email'] >> print("\n\n",request,"\n\n",myemail,"\n\n",reqfromemail) >> return >> render(request,'success.html',{"message":"congrats","name":myemail}) >> except: >> return render(request,'error.html',{"error":"It is not working >> !!!"}) >> >> >> ########################################################################################################################################### >> If i remove the href line from my template ,profile.html then my app >> runs normally !! >> So obviously there is some mistake that i am doing while using href ,or >> sending url parameters or in extracting it. Also what is the use of >> reverse() in django i read the documentation but i am unable to understand >> it !! >> >> -- >> 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 django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/f300d565-d747-46a4-b685-2c1df8bb2d19%40googlegroups.com >> <https://groups.google.com/d/msgid/django-users/f300d565-d747-46a4-b685-2c1df8bb2d19%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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 django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAB%2BAj0s2bQxBnLXyThY8ADopf2iKDFJ4DbPRqiaJY8bXkndjhQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAB%2BAj0s2bQxBnLXyThY8ADopf2iKDFJ4DbPRqiaJY8bXkndjhQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPJbmvsF%2BKTSwxjGdu%3Dt6qxdgN7B2CvoZqKB2888%3DsT%2BEyMoXQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.