我卡到這個問題上的Django 1.6的Django 1.6:名稱 '網站地圖' 沒有定義
這是我sitemaps.py
from django.contrib import sitemaps
from django.core.urlresolvers import reverse
from 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()
這是我urls.py
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
from django.contrib.sitemaps import Sitemap
from sitemaps.py import ContratalosSitemap
#Declaration for 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'$
)
我我陷入了這個問題,可能是什麼原因?
,但沒有運氣尚未=/
任何想法嗎?
在此先感謝!
非常感謝! – NeoVe