added sitemap and robots.txt

This commit is contained in:
DerTyp187
2021-11-19 10:14:56 +01:00
parent 74d8f41426
commit ca32c61c7f
5 changed files with 37 additions and 4 deletions

View File

@@ -1,3 +1,4 @@
from django.http.response import HttpResponse
from django.shortcuts import render, redirect
from .models import Category, Topic
from analytics.models import View
@@ -65,10 +66,11 @@ def about(req):
def privacy(req):
return render(req, "main/privacy.html")
def get_client_ip(req):
x_forwarded_for = req.META.get("HTTP_X_FORWARDED_FOR")
if x_forwarded_for:
ip = x_forwarded_for.split[","][0]
else:
ip = req.META.get("REMOTE_ADDR")
return ip
return ip