I ran into an issue trying to generate a sitemap.xml file with Django’s built in sitemap view. After reading the documentation over a few times I still received the error:
Django sitemap: ‘module’ object has no attribute ‘values’
For some reason, it wasn’t obvious to me what the confusion was, but clearly others have encountered the issue as well. A quick google search turned up a question on StackOverflow. User KuB had asked a question which looked very similar to the one I had just experienced.
After a bit of research and experimentation I was able to resolve the issue and came up with a bit of code that resolved the issue for me:
The full coding sample that I used looks like the following:
1 2 3 4 5 6 7 8 9 10 11 12
1 2 3 4 5 6 7 8 9 10 11
You can find the full thread out on StackOverflow here.