I haven't used this group in a long time, so I hope I do everything
correctly. If I don't, I apologize in advance.

I thought I understand the way django uses URL's in the urlconf to match
URL's, but I was wrong. Here's my question:

Here's my urlconf. . .
    url(r'^all/$', 'article.views.articles'),
    url(r'^get/(?P<article_id>\d+)/$', 'article.views.article'),
    url(r'^language/(?P<language>[a-z\-]+)/$', 'article.views.language'),
    url(r'^create/$', 'article.views.create'),)

and here's the other one in the site directory.
urlpatterns = patterns('',

    (r'^articles/', include('article.urls')),
    url(r'^accounts/login/$', 'mysite.views.login'),
    url(r'^accounts/auth/$', 'mysite.views.auth_view'),
    url(r'^accounts/logout/$', 'mysite.views.logout'),
    url(r'^accounts/loggedin/$', 'mysite.views.loggedin'),
    url(r'^accounts/invalid/$', 'mysite.views.invalid_login'),
    url(r'^accounts/register/$', 'mysite.views.register_user'),
    url(r'^accounts/register_success/$', 'mysite.views.register_success'),)

Here's the question: If I have the URL "
http://127.0.0.1:8000/articles/create/"; it works fine and takes me to the
correct page. But why does it work when I have the "/article" in the url.
According to the urlconf last entry r'^create/$', it should only match a
url with "/create" NOT a url with "/article/create". The caret means
"starts with" and the $ means "end with", so to get to the "create" page it
should be a url with just "/create/" in it, right?

I've looked at the django docs explanation, I've gone through every web
site that talks about this, I understand regex, but I still don't
understand why this is happening.

Any help is GREATLY appreciated.

Thanks,
Chris Kavanagh

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to