On Thu, Mar 3, 2011 at 4:00 PM, luca72 <lucabe...@libero.it> wrote:
> hello i have define this in the url:
> (r'^admin/', include(admin.site.urls)),
>    (r'^accounts/login/$', 'django.contrib.auth.views.login'),
>    (r'^mostro_prima', 'prova.test_sito.views.mostro_prima'),
>    (r'$', 'prova.test_sito.views.mostro_prima'),
>    (r'^inserisco/', 'prova.test_sito.views.inserisco'),
>    (r'^/registrazione/', 'prova.test_sito.views.registrazione'),
>    (r'^scarico/(\d+)', 'prova.test_sito.views.scarico'),
>    (r'^login_us/', 'prova.test_sito.views.login_us'),
>    (r'^registrazione/', 'prova.test_sito.views.registrazione'),
>    (r'^info/(\d)', 'prova.test_sito.views.info'),
>    (r'^chiarimenti/(\d+)', 'prova.test_sito.views.chiarimenti'),
>
> when i go to www.mysite.net
> i correctly see the page, but when i try to reach other page i get
> every time the same first page, where is my mistake?
>
> thanks
>
> Luca
>

In addition/correction to what Mike said:

(r'$', 'prova.test_sito.views.mostro_prima'),

This regexp '$', literally means - "does this string contain the
sequence 'end of string'", which of course, all strings do, so every
request with a URL that is not matched by one of the URLs preceding
this one will be routed to this view. This is the same as Mike has
told you.

The correction is not to fiddle with the ordering of your regular
expressions, it is better to fix your regular expression so that it is
correct. I am 99.999% certain that you meant the regular expression to
match the empty string, in which case the regexp should be '^$'. With
that fixed, the ordering is irrelevant.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to