Bernard,

I originally replied by email, so this may get double posted. Your
problem is that you have the URL for the flat pages module above the
one for the weblog. The empty string '' is basically a catch all,
which is stopping it from ever seeing the weblog. When Django parses
the URLs, it does so in the order you have them listed.

Mark

On Dec 8, 7:39 am, bernard <guitahfr...@gmail.com> wrote:
> Hi all,
>
> I am reading through the Practical Django Projects 2nd Edition book
> and i am now on the weblog entries_index part (page 84) where im
> trying to view the weblog entry index but I get an error No FlatPage
> matches the given query.
>
> I followed exactly what's written in the book.
> Please help, I'm new to Django and Python:
>
> Here's my views.py
> from django.shortcuts import render_to_response
> from coltrane.models import Entry
>
> def entries_index(request):
>     return render_to_response('coltrane/entry_index.html',
>                     { 'entry_list': Entry.objects.all() })
>
> urls.py
> from django.conf.urls.defaults import *
> from coltrane.models import Entry
>
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
>
>     (r'^admin/', include(admin.site.urls)),
>     (r'^tiny_mce/(?P<path>.*)$', 'django.views.static.serve',
>                 { 'document_root': '/home/bernard/Django/cms/
> tiny_mce/' }),
>     (r'^search/$', 'cms.search.views.search'),
>     (r'', include('django.contrib.flatpages.urls')),
>     (r'^weblog/$', 'coltrane.views.entries_index'), s
>
> )
>
> Thank you!!!

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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