add: все для sitemaps.xml + robots.txt

This commit is contained in:
2026-09-06 23:42:00 +03:00
parent a969e12233
commit 1a61f36fc1
5 changed files with 178 additions and 0 deletions
+5
View File
@@ -1,6 +1,7 @@
import hashlib
from django.db import models, transaction, IntegrityError
from django.db.models import F
from django.urls import reverse
from hashids import Hashids
from hypn0.settings import *
from django.utils import timezone
@@ -157,6 +158,10 @@ class TbHypn0Item(models.Model):
def __str__(self) -> str:
return f"{self.s_title} ({self.s_hash_id})"
def get_absolute_url(self) -> str:
"""Возвращает канонический URL детальной страницы картины."""
return reverse("hypn0_site:gallery_detail", kwargs={"hash_id": self.s_hash_id})
@property
def card_bg_style(self) -> str:
"""