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