Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install django-google-tools

How to install django-google-tools

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-google-tools
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1.3
1.0.0Never BuiltWhy not?
0.1.3 Available View build log
Windows (64-bit)
0.1.3
1.0.0Never BuiltWhy not?
0.1.3 Available View build log
Mac OS X (10.5+)
1.0.0 Available View build log
0.1.3 Available View build log
Linux (32-bit)
1.0.0 Available View build log
0.1.3 Available View build log
Linux (64-bit)
1.0.0 Available View build log
0.1.3 Available View build log
 
License
MIT
Lastest release
version 1.0.0 on Apr 21st, 2013
Build Status

Django app for managing Google Analytics and Site Verification codes.

Installation

In your virtualenv just type:

$ pip install django-google-tools

Configuration

  1. Add googletools to your INSTALLED_APPS:

    INSTALLED_APPS = (
        'django.contrib.admin',
        'django.contrib.auth',
        'django.contrib.contenttypes',
        'django.contrib.sessions',
        'django.contrib.sites',
        ...
        'googletools',
        ...
    )
    
  2. Run in your shell:

    $ ./manage.py syncdb
    

Or if you are using South:

$ ./manage.py migrate

If you have in your settings DEBUG=True googletools will not render anything because this library is inteded mostly to use on production sites, if you want to change this behavior you can set GOOGLETOOLS_ENABLED=True in your settings file. Just for clarification it is defined like this:

GOOGLETOOLS_ENABLED = not DEBUG

This means, by default googletools will be enabled when DEBUG=False.

Management

Go to the admin interface. When correctly installed, you will find the Googletools app. There you can manage your Google Analytics and Site Verification codes.

Templatetags

In order to use the googletools in your templates you'll have to load the templatetags.

{% load googletools %}

Use {% analytics_code %} for inserting your Analytics code.

Use {% site_verification_code %} for inserting your site verification code.

Templatetags will return an empty string if they are not configured for the current site.

The template should look like:

{% load googletools %}
<html>
    <head>
        <meta charset="utf-8">
        ...
        <meta name="description" content="..." />
        {% site_verification_code %}

        <link rel="stylesheet" href="/static/css/style.min.css">

        {% analytics_code %}
    </head>
    <body>
        <h1>My awesome project</h1>
        ...
    </body>
</html>

Subscribe to package updates

Last updated Apr 21st, 2013

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.