( jur - nay - sic ) Entrepreneur / Software Engineer

Django Sitemap

In setting up this blog I came up with the problem of setting up a sitemap. I didn’t want to use a django flatpage because I already an template and use for them, not to mention the amount of work that it would take to maintain. A quick search on Google turned up that django already has some sitemap functionality built right into the contrib! Awesome! Here is the code that was used.

First I created a new app to hold the logic for my site maps: site_sitemap. The models.py looks like this:

Then in the urls.py I put this:

And that was about it.

Follow Us

Follow our activity on the web and get to know us.