22 lines
432 B
Python
22 lines
432 B
Python
|
from django.shortcuts import render
|
||
|
from django.http import HttpResponse
|
||
|
|
||
|
|
||
|
def robots_txt(request):
|
||
|
txt = '''User-agent: *
|
||
|
Disallow:
|
||
|
'''
|
||
|
return HttpResponse(txt, 'text/plain')
|
||
|
|
||
|
txt = '''User-agent: *
|
||
|
Disallow:
|
||
|
Sitemap: {}
|
||
|
'''.format(request.build_absolute_uri('/sitemap.xml'))
|
||
|
return HttpResponse(txt, 'text/plain')
|
||
|
|
||
|
|
||
|
def sitemap_xml(request):
|
||
|
sitemap = ''
|
||
|
return HttpResponse(sitemap, 'application/xml')
|
||
|
|