o-users@googlegroups.com
Sent: Sunday, August 5, 2012 4:51:46 PM
Subject: Re: named url patterns - invalid syntax
Al 05/08/12 13:43, En/na Blaxton ha escrit:
>
> Hi
>
> Why following line cause an invalid syntax :
> (r'^myform/$', 'mysite.views.myform', nam
Hi,
You are probably not using the url() function, but just the tuple format.
You should have something like:
urlpatterns = patterns('',
url(r'^myform/$', 'mysite.views.myform', name="myform")
)
instead of
urlpatterns = patterns('',
(r'^myform/$', 'mysite.views.myform', name="myform")
)
The
Al 05/08/12 13:43, En/na Blaxton ha escrit:
Hi
Why following line cause an invalid syntax :
(r'^myform/$', 'mysite.views.myform', name="myform"),
Because it's syntax is invalid: the 'name=value' is allowed in function
calls but not in tuples.
Try with:
urlpatterns = patterns('',
url(r
On Sunday, 5 August 2012 12:43:48 UTC+1, Blaxxton wrote:
>
>
> Hi
>
> Why following line cause an invalid syntax :
> (r'^myform/$', 'mysite.views.myform', name="myform"),
>
> it seems named url pattern has changed from name="myform" to just 'myform'
> because when I change it to:
> (r'^myform/$',
Hi
Why following line cause an invalid syntax :
(r'^myform/$', 'mysite.views.myform', name="myform"),
it seems named url pattern has changed from name="myform" to just 'myform'
because when I change it to:
(r'^myform/$', 'mysite.views.myform', 'myform'),
it pass the syntax error and throw
Thanks, that was it. Bit of a simple one I probably should have
spotted.
Andrew
On 25 Sep, 19:42, Tim Chase wrote:
> > Can somebody tell me why i get a syntax error with this named URL
> > pattern?
>
> > urlpatterns = patterns('',
> > url(r'^feed/(?P.*)/$',
> > 'django.contrib.syndicati
> Can somebody tell me why i get a syntax error with this named URL
> pattern?
>
> urlpatterns = patterns('',
> url(r'^feed/(?P.*)/$',
> 'django.contrib.syndication.views.feed',
> {'feed_dict': feeds}
looks like a missing comma here...
> name="feed"),
> )
-tim
--~--~---
Can somebody tell me why i get a syntax error with this named URL
pattern?
urlpatterns = patterns('',
url(r'^feed/(?P.*)/$',
'django.contrib.syndication.views.feed',
{'feed_dict': feeds}
name="feed"),
)
This is the traceback:
Traceback:
File
i think you may need to "name" the argument. For example:
url(r'^$', list_detail.object_list, {'queryset': Project.objects.all()},
name='project-home'),
keith
On Fri, Oct 17, 2008 at 4:59 PM, Karen Tracey <[EMAIL PROTECTED]> wrote:
> On Fri, Oct 17, 2008 at 3:30 PM, dkadish <[EMAIL PROTECTED]
On Fri, Oct 17, 2008 at 3:30 PM, dkadish <[EMAIL PROTECTED]> wrote:
>
> Okay. I think the issue is that I am trying to use reverse( ) in the
> URLConf file. According to the django docs, "the reverse() function
> has to import all of your URLConf files and examine the name of each
> view". My thin
Okay. I think the issue is that I am trying to use reverse( ) in the
URLConf file. According to the django docs, "the reverse() function
has to import all of your URLConf files and examine the name of each
view". My thinking is that this is leading to to attempt to import
itself as it evaluates th
Do you know if there's an easy way to try and figure out where
reverse( ) is looking for the pages?
On Oct 17, 11:24 am, dkadish <[EMAIL PROTECTED]> wrote:
> Nope. Tried that.
>
> This shouldn't (I don't think) make any difference but I am running
> Django 1.0, Python 2.5, Apache 2.210 on Windows
Nope. Tried that.
This shouldn't (I don't think) make any difference but I am running
Django 1.0, Python 2.5, Apache 2.210 on Windows Server 2003 with SQL
Server 2005 as the db (I know, I know...out of my hands)
David
On Oct 17, 11:19 am, Steve Holden <[EMAIL PROTECTED]> wrote:
> dkadish wrote:
dkadish wrote:
> I'm having issues with a named URL pattern in my code. Django does not
> seem to be finding the correct URL when the {% url %} and reverse( )
> tag/functions are used.
>
> the urls.py file at app_root/project/urls.py contains:
>
> from django.views.generic import list_detail, crea
I'm having issues with a named URL pattern in my code. Django does not
seem to be finding the correct URL when the {% url %} and reverse( )
tag/functions are used.
the urls.py file at app_root/project/urls.py contains:
from django.views.generic import list_detail, create_update
from maverick.pro
On 19 Gru, 18:02, shabda <[EMAIL PROTECTED]> wrote:
> I can get access to a named url from within a template by using {% url
> %} tag. What can I do to get access to named url from a view function?
use reverse() method:
http://www.djangoproject.com/documentation/url_dispatch/#reverse
--~--~
I can get access to a named url from within a template by using {% url
%} tag. What can I do to get access to named url from a view function?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To po
Solved.
The url names were apparently being cached, so it appeared that naming a
included url didn't work.
Lesson: always restart django when changing url names
-Justin
On 11/18/07, Justin Fagnani <[EMAIL PROTECTED]> wrote:
>
> I've noticed that if you're trying to
I've noticed that if you're trying to use named url patterns with an
included urlconf that you need to label the pattern that includes the
urlconf as well as the pattern being included with the same name. This seems
to prevent having more than one named url in an included urlconf.
to decalre my URL linked to the same view in number of
> arguments descending ... so if one arg was given the first (r'member/
> status(?P\d+)/(?P\d+)/$', 'app.views_admin.member_list')
> didn't match then the (r'member/status(?P\d+)/$',
> 'ap
mber_list')
didn't match then the (r'member/status(?P\d+)/$',
'app.views_admin.member_list') mached. If no argument was given the
first two URL pattern didn't match so the last one matched. This is
not the case with the latest SVN version
I guess this is a side ef
On Fri, 2007-06-15 at 07:40 +1000, Malcolm Tredinnick wrote:
> On Thu, 2007-06-14 at 14:17 -0700, Smoo.Master wrote:
> > I have using django to make a sort of library website.
> >
> > Since I am mostly using generic views, I use the {% url %} tag (which
> > calls rever
On Thu, 2007-06-14 at 14:17 -0700, Smoo.Master wrote:
> I have using django to make a sort of library website.
>
> Since I am mostly using generic views, I use the {% url %} tag (which
> calls reverse) with named url patterns in my templates. However this
> became quite slow (as
I have using django to make a sort of library website.
Since I am mostly using generic views, I use the {% url %} tag (which
calls reverse) with named url patterns in my templates. However this
became quite slow (as I verified with the hotshot profiler). On a page
with several hundred links, it
Hey Ryan,
On Wed, 2007-04-25 at 16:23 +, Ryan Kanno wrote:
> Already a ticket? Shoot, I swore I searched, but I couldn't find
> one. Sorry about that - my apologies.
>
> (http://code.djangoproject.net/ticket/4129)
No problems -- I forgot to point you to the ticket number, too.
Anyway, th
gt; I'm just curious if named URL patterns will be able to use the prefix
> > given (or if there's any reason not to) ie,
>
> > urlpatterns += patterns('my_pattern',
> > url(r'^(?P[\d]+)/$', 'details',
&
On Tue, 2007-04-24 at 15:21 +, Ryan Kanno wrote:
> I'm just curious if named URL patterns will be able to use the prefix
> given (or if there's any reason not to) ie,
>
> urlpatterns += patterns('my_pattern',
> url(r
I'm just curious if named URL patterns will be able to use the prefix
given (or if there's any reason not to) ie,
urlpatterns += patterns('my_pattern',
url(r'^(?P[\d]+)/$', 'details',
name="my-details"),
On Apr 21, 1:53 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> [snip]
> We haven't documentedreverse() anywhere, as far as I know. So worth
> filing a ticket.
>
I realize that urlresolvers.reverse() was not documented earlier, but
does the addition of named urls mean that the old behavior is
urn HttpResponseRedirect( reverse( 'your-url-name' ) )
>
> Have I missed something and this was documented else where? Otherwise
> I'll raise a ticket to update the above documentation for named url
> patterns...
We haven't documented
Otherwise
I'll raise a ticket to update the above documentation for named url
patterns...
Cheers,
Michael
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to thi
31 matches
Mail list logo