Friday, February 1, 2019

Re: Unable to load Google Tag Manager in my Django admin app

Here my aim was to use geoplugin with GTM in my Django app.
For this I need to hit following url first to get authorize in geoplugin site-

That's why I have created two html files.

On Friday, February 1, 2019 at 3:39:57 PM UTC+5:30, prateek gupta wrote:
Hi All,

I am trying to use Google Tag Manager(GTM) in my Django 2.0.6 application by following below url-

In GTM console I have set my app but when I preview my app, GTM is not loading.
I suspect I am missing something with respect to my templates.

Below is my project structure-

django_project.JPG


In base.html I have put following code-
{% load gtm_tags %}

<html>
   
<head>
       
{% gtm_head %}
       
<title>GTM testing</title>
       
<link rel="stylesheet" type="text/css" href="/static/admin/css/base.css" />
       
<link rel="stylesheet" type="text/css" href="/static/admin/css/login.css" />
   
</head>
   
<body class=" login">
    {% gtm_body %}
       
<div id="container">
           
<div id="header">
               
<div id = "branding">
                   
<h1 id="site-name">GTM Testing Page</h1>
               
</div>
           
</div>
           
<div id="content">
               
<div id="content-main">
                     {% block content %}
                     {% endblock %}
               
</div>
           
</div>
       
</div>
   
</body>
</html>

In authorize_geoplugin.html I have put following lines-
{% extends 'base.html' %}

{% block content %}
   
<html>
       
<body>ABCDEFGHIJUTLOPP</body>
   
</html>

{% endblock %}

And in settings.py I have added the package as below-

settings.JPG


It's a basic templates setup I have done just for GTM.

Can anyone please tell me what I am doing wrong here?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4ce04497-b004-49d5-8d10-815c8fb25c77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment