mirror of
https://github.com/DerTyp7/tealcode-django-python.git
synced 2025-10-30 20:57:07 +01:00
added sitemap and robots.txt
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user