i'm stuck issue on django 1.6
this sitemaps.py
from django.contrib import sitemaps django.core.urlresolvers import reverse datetime import datetime class contratalossitemap(sitemap): def __init__(self, names): self.names = names def items(self): return self.names def changefreq(self, obj): return 'weekly' def lastmod(self, obj): return datetime.now() this urls.py
from django.conf.urls import patterns, include, url django.conf import settings django.contrib import admin django.contrib.sitemaps import sitemap sitemaps.py import contratalossitemap #declaration sitemaps url sitemaps = { 'pages' : contratalossitemap, } urlpatterns = patterns( 'apps.contratalos.views', url(r'c/(?p<slug>\.*[^ ]{1,128})?/', 'c', name='content'), url(r'^sitemap\.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps'$ ) i'm stuck this, cause?
but no luck yet =/
any ideas please?
thanks in advance!
with import sitemap imported module name. if want use in module, need write sitemap.sitemap.
if write from sitemap import sitemap import sitemap class module , can use directly, in code.
you can from sitemap import *, import definitions in module. not recommend, since use few names it.
Comments
Post a Comment