The urls are a first come first served ... that is the first url that match
is served

On your url file there are 4 urls that match on the same pattern. I
recommend you to write urls that are impossible to match against each
other, and if some url is able to match others write that one in the last
possition in the list.

Peace!




2014-07-19 13:01 GMT+01:00 ngangsia akumbo <[email protected]>:

> Good After Django Users
>
> I still have problems with urls.
> Please somebody should take a carful look at this urls
>
> urlpatterns = patterns('',
>     url(r'^admin/', include(admin.site.urls)),
>     #new urls
>     url(r'^$', PostListView.as_view(), name='news-list'),
>
>     url(r'^(?P<slug>[-_\w]+)/$', PostDetailView.as_view(),
> name='blogs-detail'),
>
>     #events urls
>     url(r'^$', EventListView.as_view(), name='events-list'),
>     url(r'^(?P<slug>[-_\w]+)/$', EventDetailView.as_view(),
> name='events-detail'),
> )
>
> when i type http://127.0.0.1:8000/ on the browser, this url
>
> url(r'^$', PostListView.as_view(), name='news-list'),
>
> will list all the news by their headlin in the form of a link.
>
> when i click on the url it output the content of the news , that is giving
> me the detail url of that news headline.
> this url
>
> url(r'^(?P<slug>[-_\w]+)/$', PostDetailView.as_view(),
> name='blogs-detail'),
>
> will take care of outputting the content
>
> Ok now i have created a second app called events with the following urls
>
>  url(r'^$', EventListView.as_view(), name='events-list'),
>  url(r'^(?P<slug>[-_\w]+)/$', EventDetailView.as_view(),
> name='events-detail'),
>
> so how do i open the url for event cos when i type http://127.0.0.1:8000/
> it outputs only
> the url for news, that is the first url above.
>
>  --
> 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 [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/380a0bd3-85a2-4765-91b2-1888f4ea0b73%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/380a0bd3-85a2-4765-91b2-1888f4ea0b73%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotsoft.es/blog/

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BxOsGD9mMMUdb3y%3DRL8T_EDR7%3Dkq4LML81O_OHk0seEUNtD7g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to