I want to implement django sitemaps but I'm little confused about where to put the sitemaps.py file and which urls.py file should i modify to include:
url(r'^sitemap.xml$', 'django.contrib.sitemaps.views.index', {'sitemaps': sitemaps}),
Shall I put the above line in project(mysite) urls.py file or the app(sampleapp1) urls.py file?
You create sitemaps within the apps of your project (the ones you need sitemaps), documentation doesn't state what and where because you are free to do as you like, you only need to register them in a dictionary which is passed in the url. For example, you have a
your_project
which has ablog
app:In your sitemap.py:
Then in your urls.py (main urls.py of your project):
You repeat the same for every sitemap you need, if your project is big (many apps) it would be wise to use different sitemaps per app, then in your urls.py: