robots.txt && sitemap.xml
This commit is contained in:
parent
350488e748
commit
5e0328f5b1
@ -72,6 +72,7 @@ class Announcement(models.Model):
|
||||
class Meta:
|
||||
verbose_name = 'Ogłoszenie'
|
||||
verbose_name_plural = 'Ogłoszenia'
|
||||
ordering = ['-created_at']
|
||||
|
||||
|
||||
class UserManager(BaseUserManager):
|
||||
|
4
app/templates/robots.txt
Normal file
4
app/templates/robots.txt
Normal file
@ -0,0 +1,4 @@
|
||||
User-agent: *
|
||||
Disallow: /admin
|
||||
|
||||
Sitemap: https://puchar.lo5.bielsko.pl/sitemap.xml
|
44
app/templates/sitemap.xml
Normal file
44
app/templates/sitemap.xml
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://puchar.lo5.bielsko.pl</loc>
|
||||
<priority>1.0</priority>
|
||||
<changefreq>yearly</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://puchar.lo5.bielsko.pl/aktualnosci</loc>
|
||||
<priority>0.9</priority>
|
||||
<lastmod>{{ latest.created_at | date:"Y-m-d" }}</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://puchar.lo5.bielsko.pl/regulamin</loc>
|
||||
<priority>0.8</priority>
|
||||
<changefreq>never</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://puchar.lo5.bielsko.pl/zadania</loc>
|
||||
<priority>0.8</priority>
|
||||
<changefreq>yearly</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://puchar.lo5.bielsko.pl/wyniki</loc>
|
||||
<priority>0.5</priority>
|
||||
<changefreq>yearly</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://puchar.lo5.bielsko.pl/kontakt</loc>
|
||||
<priority>0.7</priority>
|
||||
<changefreq>never</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://puchar.lo5.bielsko.pl/login</loc>
|
||||
<priority>0.6</priority>
|
||||
<changefreq>never</changefreq>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://puchar.lo5.bielsko.pl/rejestracja</loc>
|
||||
<priority>0.6</priority>
|
||||
<changefreq>never</changefreq>
|
||||
</url>
|
||||
</urlset>
|
@ -1,6 +1,6 @@
|
||||
from django.urls import path
|
||||
|
||||
from .views import SignUpView, SubmitStudentsView, UpdateAccountView, ScoresRedirect, HomeView, NewsView, ScoresView, RulesView, TestsView, ContactView
|
||||
from .views import SignUpView, SubmitStudentsView, UpdateAccountView, ScoresRedirect, HomeView, NewsView, ScoresView, RulesView, TestsView, ContactView, RobotsView, SitemapView
|
||||
|
||||
urlpatterns = [
|
||||
path('', HomeView.as_view(), name='home'),
|
||||
@ -13,5 +13,8 @@ urlpatterns = [
|
||||
path('rejestracja/', SignUpView.as_view(), name='signup'),
|
||||
|
||||
path('konto/', UpdateAccountView, name='account'),
|
||||
path('zgloszenie/', SubmitStudentsView, name='submission')
|
||||
path('zgloszenie/', SubmitStudentsView, name='submission'),
|
||||
|
||||
path('robots.txt', RobotsView.as_view()),
|
||||
path('sitemap.xml', SitemapView.as_view())
|
||||
]
|
||||
|
13
app/views.py
13
app/views.py
@ -144,3 +144,16 @@ class ContactView(TemplateView):
|
||||
extra_context = {
|
||||
'contact_page': 'is-active'
|
||||
}
|
||||
|
||||
|
||||
class RobotsView(TemplateView):
|
||||
template_name = 'robots.txt'
|
||||
content_type = 'text/plain'
|
||||
|
||||
|
||||
class SitemapView(TemplateView):
|
||||
template_name = 'sitemap.xml'
|
||||
content_type = 'text/xml'
|
||||
extra_context = {
|
||||
'latest': Announcement.objects.first()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user