This commit is contained in:
DerTyp187
2021-11-23 18:59:31 +01:00
parent c6ae46342e
commit 073c79bad5
17 changed files with 5 additions and 174 deletions

View File

@@ -1,4 +1,4 @@
# Generated by Django 3.2.9 on 2021-11-22 18:23
# Generated by Django 3.2.9 on 2021-11-23 17:55
from django.db import migrations, models
import django.db.models.deletion

View File

@@ -4,14 +4,9 @@
<head>
<!-- Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PGM5LTFSMG"></script>
<script>
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-213552250-1', {
'storage': 'none',
});
ga('send', 'pageview');
</script>
<script>window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;ga('create', 'UA-213552250-1', {'storage': 'none',});ga('send', 'pageview');</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script src="{% static 'js/cookies.js' %}"></script>
<!-- End Google Analytics -->
<!-- Required META Tags-->
@@ -38,7 +33,7 @@
{% endif %}
</head>
<body class="bg-dark">
<script src="{% static 'js/cookies.js' %}"></script>
<header class="p-3 bg-dark text-white shadow">

View File

@@ -1,11 +1,8 @@
from django.http.response import HttpResponse, HttpResponseForbidden
from django.http.response import HttpResponse
from django.shortcuts import render, redirect
from .models import Category, Topic, Rating
from analytics.models import View
def index(req):
view = View(ip=get_ip(req), custom_title="index")
view.save()
categorys_obj = Category.objects.all()
return render(req, "main/index.html", {'categorys': categorys_obj})
@@ -40,10 +37,6 @@ def topic(req, category, topic):
'notHelpful_count': notHelpful_count,
'read_more': topic_obj.read_more,
}
view = View(ip=get_ip(req), topic=topic_obj)
view.save()
return render(req, "main/topic.html", context)
return redirect("main-index")
@@ -57,9 +50,6 @@ def category(req, category):
if category_obj:
topics_obj = Topic.objects.filter(category=category_obj)
view = View(ip=get_ip(req), category=category_obj)
view.save()
context = {
'category_obj': category_obj,
'topics': topics_obj,
@@ -83,8 +73,6 @@ def search(req, value): # https://django-taggit.readthedocs.io/en/latest/getting
def sitemap(req):
topics = Topic.objects.all()
categories = Category.objects.all()
#REPLACE ALL BLANKS WITH %20
context = {
'topics': topics,