Skip to content

Commit

Permalink
add sitemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
abubakerKhaled committed Oct 30, 2024
1 parent 8e990dd commit c30ea1e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
12 changes: 12 additions & 0 deletions posts/sitemaps.py
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 PostSitempa(Sitemap):
changefreq = 'weekly'
priority = 0.9

def items(self):
return Post.published.all()

def lastmod(self, obj):
return obj.updated
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
asgiref==3.8.1
Django==5.1.2
django-taggit==6.1.0
Markdown==3.7
psycopg==3.2.3
python-decouple==3.8
sqlparse==0.5.1
typing_extensions==4.12.2
tzdata==2024.2
20 changes: 11 additions & 9 deletions scribly/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@
# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'taggit',
'posts.apps.PostsConfig',
'users.apps.UsersConfig',
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.sites",
"django.contrib.sitemaps",
"django.contrib.staticfiles",
"taggit",
"posts.apps.PostsConfig",
"users.apps.UsersConfig",
]

MIDDLEWARE = [
Expand Down

0 comments on commit c30ea1e

Please sign in to comment.