Extra space in the match string

721 views
Skip to first unread message

tsmets

unread,
Sep 24, 2008, 7:03:02 AM9/24/08
to Django users
I am refactoring my URL matching configuration file and I get this :
[snip]
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/followDeploys/viewDeployed/xxx

Using the URLconf defined in customer.urls, Django tried these URL
patterns, in this order:

1. ^followDeploys/ ^viewDeployed/(?P<appAcronym>[^a-z][a-z0-9][a-
z0-9])
2. ^admin/(.*)

The current URL, followDeploys/viewDeployed/xxx, didn't match any of
these.
[/snip]

Now there is an extra space in the first matching URL pattern.

My top level URL.py
###############################################
from django.conf.urls.defaults import *


# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns ('',
# Follow deploys :
(r'^followDeploys/',include('customer.follow_deploys.urls')),

# Uncomment the admin/doc line below and add
'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),

(r'^admin/(.*)', admin.site.root),
)
###############################################


Then my url.py in follow_deploys is :
###############################################
from django.conf.urls.defaults import *

urlpatterns = patterns('customer.follow_deploys.views',
# Allows to view the status of one acronym
(r'^viewDeployed/(?P<appAcronym>[^a-z][a-z0-9][a-z0-9])',
'viewDeployed'),
)
###############################################


Any help is appreciated

bruno desthuilliers

unread,
Sep 24, 2008, 8:28:29 AM9/24/08
to Django users


On 24 sep, 13:03, tsmets <tsm...@gmail.com> wrote:
> I am refactoring my URL matching configuration file and I get this :
> [snip]
> Page not found (404)
> Request Method: GET
> Request URL: http://localhost:8000/followDeploys/viewDeployed/xxx
>
> Using the URLconf defined in customer.urls, Django tried these URL
> patterns, in this order:
>
> 1. ^followDeploys/ ^viewDeployed/(?P<appAcronym>[^a-z][a-z0-9][a-
> z0-9])

Are you sure the last part (<appAcronym) is ok ??? "[^a-z]" means
"everything *but* a character in range a-z".

> 2. ^admin/(.*)
>
> The current URL, followDeploys/viewDeployed/xxx, didn't match any of
> these.
> [/snip]
>
> Now there is an extra space in the first matching URL pattern.


AFAICT, this 'extra space' is in the error page display only, not in
the pattern effectively used for matching - I can see similar things
here with patterns that I know are ok and working.

You didn't specify the effective value of the appAcronym part you used
for your tests, but it won't match anything starting with a lowercase
letter.

My 2 cents...

Keith Eberle

unread,
Sep 24, 2008, 9:42:18 AM9/24/08
to django...@googlegroups.com
the space indicates passing the URL off to an included urls.py.

keith
Reply all
Reply to author
Forward
0 new messages