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/$',
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
--~--~---
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
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 use named url patterns with an
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
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)
_RK
On Apr 24, 6:32 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2007-04-24 at 15:21 +, Ryan Kanno wrote:
> > I'm just curious
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'^(?P[\d]+)/$', 'details',
> name="my-detai
16 matches
Mail list logo