Python provides two methods to sort an array. First one is
list.sort() which sorts the array in place where as
sorted returns the sorted array and will not change the original array.
django sitemap framework is very flexible. We can use it to create sitemap for any item in thedatabase, along with custom configurations. The very basic step is to add
django.contrib.sitemaps to the installed apps. Then it is better to have our own
sitemaps.py. In the
sitemaps.py, we have to create a class by inheriting the class
django.contrib.sitemaps. In this class we can define our properties for entries in the sitemap.
We have both static and dynamic pages in a Djangoapplication. How will we add static pages to stitemap? It is very siple. As first step, we have to include
'django.contrib.sitemaps' to the installed apps.
Sitemaps are very critical for SEO. For a Django application, how can we add sitemap? The django applications has dynamic content and it is almost impossible to recreate a sitemap and upload to the site. The django sitemap framework is for our rescue.
Python provides a method
sorted which returns the sorted array and will not change the original array, where as
list.sort() with change the array in place.
When we copy-paste text from applications like MS-Word or similar to our HTML or text files, we end-up having unicode characters in the file, ultimately leading to different issues. Inlinus, itseasy to replace it from all files in current directory. A typical example is the zero width space
Regex and iregex are the two field lookups that enable us to search database with regular expressions. regex is case-sensitive where as iregexis case-insensitive.
In django, the NULL valuein the database field is tested with field lookup
isnull It takes either
False, which correspond to SQL queries of
IS NULL and
IS NOT NULL, respectively.