Is it possible to unify sitemaps from multiple model files into 1 url? I have these two in one file:
Then I have a separate models file with a 3rd class I'd like added to the sitemap:
Here is my URL. I'd like for the sitemap to generate from all 3 classes, not just the top 2. Is it possible?
Thanks. asked 18 Feb '11, 14:04 pythondjango |
Yes. In your urls.py import those classes. Create the SITEMAPS dictionary as you have done in your urls.py. The url you have specified should work just fine then. Make sure to use: from app.sitemap import CompanySitemap answered 18 Feb '11, 15:07 bmeyer71 ♦♦ I'm having trouble constructing the dictionary. Receiving the error: "unhashable type: 'dict'". urlpatterns += patterns('', (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': SITEMAPS }), ('mysite.wiki.models', {'sitemaps': SITEMAPS }),)
(18 Feb '11, 15:24)
pythondjango
Create your urls.py with the following: sitemaps = { Add your url:
(r'^sitemap
(18 Feb '11, 16:27)
bmeyer71 ♦♦
You're the man. I understand after seeing this. Thanks a bunch, off-to-the-next-error!
(18 Feb '11, 20:42)
pythondjango
|