forked from yahyaaly151989/Mastering_Django
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating a sitemap using the sitemap framework
- Loading branch information
1 parent
ebc0bd5
commit 5b0487e
Showing
7 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from django.contrib.sitemaps import Sitemap | ||
from .models import Post | ||
|
||
class PostSitemap(Sitemap): | ||
changefreq = 'weekly' | ||
priority = 0.9 | ||
|
||
def items(self): | ||
return Post.objects.all() | ||
|
||
def lastmod(self, obj): | ||
return obj.updated |
Binary file not shown.
Binary file modified
BIN
+72 Bytes
(100%)
Module03/mysite/mysite/__pycache__/settings.cpython-311.pyc
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters