![]() |
VOOZH | about |
This article is in continuation of Blog CMS Project in Django. Check this out here - Building Blog CMS (Content Management System) with Django
RSS (Really Simple Syndication) is a web feed that allows users and applications to access updates to websites in a standardized, computer-readable format. These feeds can, for example, allow a user to keep track of many different websites in a single news aggregator. Django comes with an library to create atom feed for our blog.
Go to blog app directory and create a file feeds.py and paste the below code.
To route the RSS feed go to urls.py file of the app you are using for generating feed and add the route
Sitemap protocol allows a webmaster to inform search engines about URLs on a website that are available for crawling. A Sitemap is an XML file that lists the URLs for a site. It allows webmasters to include additional information about each URL: when it was last updated, how often it changes. This allows search engines to crawl the site more efficiently and to find URLs that may be isolated from the rest of the site's content.
Django also comes with a sitemaps creator go to the blog app directory and add sitemaps to installed apps in settings file
Create a file sitemaps.py and paste the below code.
Sitemap generated should have urls for our posts so we need to add a simple function to our model so that we sitemap library can generate posts urls
Now to generate the sitemap url, Go to urls.py file of the and add the route