Skip to content

Commit 1ea73c3

Browse files
committed
Humans.txt , robots.txt , sitemap.xml eklendi.
1 parent 7f8e5d7 commit 1ea73c3

File tree

7 files changed

+29
-2
lines changed

7 files changed

+29
-2
lines changed

Blog/sitemaps.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
db = post.objects.all()
44
for i in db:
55
url_list.append("/makale/"+i.seo_url)
6+
67
# sitemaps.py
78
from django.contrib import sitemaps
89
from django.urls import reverse

Blog/views.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ def category_view(request,category_names):
3030
category_db_list = category.objects.all()
3131
category_db = category.objects.filter(category_name=str(category_names))
3232
post_db = post.objects.filter(category_list__category_name=category_names)
33-
return render(request,'category.html',locals())
33+
return render(request,'category.html',locals())
34+
35+
def human(request):
36+
return render(request,'humans.html')
37+
def robots(request):
38+
return render(request,'robots.html')

BlogProject/urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from django.contrib import admin
1818
from django.conf import settings
1919
from django.views.static import serve
20-
from Blog.views import home,about,contact,blog,makale,category_view
20+
from Blog.views import home,about,contact,blog,makale,category_view,human,robots
2121

2222
from Blog.sitemaps import StaticViewSitemap
2323
from django.contrib.sitemaps.views import sitemap
@@ -33,6 +33,8 @@
3333
url(r'^blog/', blog, name='blog'),
3434
url(r'^kategori/(?P<category_names>\w+)/$', category_view, name='category_view'),
3535
url(r'^makale/(?P<slug>[\w-]+)/$', makale, name='makale'),
36+
url(r'^humans.txt$', human, name='human'),
37+
url(r'^robots.txt$', robots, name='human'),
3638
url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps},name='django.contrib.sitemaps.views.sitemap')
3739
]
3840

templates/humans.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* TEAM
2+
----------------------------------------------------------------------------------------------------------- */
3+
4+
Author: Ali Yaman
5+
Contact: aliymn.db@mail.com
6+
Facebook: /aliymn44
7+
From: Istanbul, Turkey
8+
9+
10+
11+
/* SITE
12+
-------------------------------------------------------------------------------------- */
13+
14+
Language: English / Turkish
15+
Standards: HTML5, CSS3
16+
Components: jQuery, H5bp
17+
Software: Python, Django

templates/robots.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Allow: /
35 KB
Loading
35 KB
Loading

0 commit comments

Comments
 (0)