"hello world" wouldn't match \w either. \w is letters, numbers, and
the underscore.

On Tue, Apr 21, 2015 at 3:58 PM, HIMANSHU RANJAN
<livelikehimansh...@gmail.com> wrote:
> Hello Stephen ,
> Even if I pass simple string like "hello world" instead of email address ,
> it doesn't work !!
>
> I don't know what's the pblm
> Plzz help !!
>
> On Apr 22, 2015 2:16 AM, "Stephen J. Butler" <stephen.but...@gmail.com>
> wrote:
>>
>> \w won't match emails addresses. It doesn't include the "." or "@"
>> characters.
>>
>> On Tue, Apr 21, 2015 at 3:41 PM, HIMANSHU RANJAN
>> <livelikehimansh...@gmail.com> wrote:
>> > 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.
>> >>> 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.
>> >>
>> >> 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.
>>
>> --
>> 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/CAD4ANxV6EzbHHSo%3Dk6sy1Bka6rwy_fD%2BKhoyZp3WLq464%3DOr_g%40mail.gmail.com.
>> 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/CAPJbmvtGjZuAH%2BvfqQgxWKqVq2DHqqZODBH8ET1Muon5vPRzXw%40mail.gmail.com.
>
> 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/CAD4ANxWkR4X%3DydTUJ97gs4O%3Dw2Ph0dULewdiYygN3yunAjAG%2BA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to