(r'^sitemap.xml$',
and
http://patrickbeeson.com/sitemaps.xml.

are different urls

On Feb 14, 10:56 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I'm using Django to publish my Web site and blog, and would like to
> use the sitemaps app that comes with Django. But I can't get the urls
> or sitemaps file configured right.
>
> Here is my sitemaps.py file:
>
> from django.contrib.sitemaps import Sitemap
> from patrickbeeson.apps.blog.models import Entry
> import datetime
>
> class BlogSitemap(Sitemap):
>     changefreq = 'never'
>     priority = 0.5
>
>     def items(self):
>         return Entry.objects.filter(status=3)
>
>         def lastmod(self, obj):
>                 return obj.pub_date
>
>         def location(self, obj):
>                 return "/blog/%s" % obj.slug
>
> Here is my urls:
>
> from django.contrib.sitemaps import FlatPageSitemap
> from patrickbeeson.sitemaps import BlogSitemap
>
> sitemaps = {
>         'blog': BlogSitemap,
>     'flatpages': FlatPageSitemap,
>
> }
>
> urlpatterns = patterns('',
>         # Sitemaps
>         (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap',
> {'sitemaps': sitemaps}),
>         (r'^sitemap-(?P<section>.+).xml$',
> 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
>
> )
>
> I thought the sitemaps would be viewable at this 
> URL:http://patrickbeeson.com/sitemaps.xml.
>
> What am I doing wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to