Skip to main content

Track external links with a signal on click.

Project description

Captures clicks on external links, and invokes a callback (signal).

Useful for tracking outbound links.

pip install django-external-urls

Settings:

Add to settings.py:

INSTALLED_APPS = (
    'external_urls',
)

Add to url.py:

urlpatterns = patterns('',
    url(r'', include('external_urls.urls')),
)

Usage:

  1. The templates can be used as follows:

    {% load external_urls %}
    {% external_url object.website %}
    {% external_url "http://example.com/" %}
  2. Sends a Signal, external_link:

    from external_links.signals import external_click
    from django.dispatch import receiver
    
    @receiver(external_click)
    def my_callback(sender, url, ip):
        print("tracked click to {} from {}".format(url, ip))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-external-urls-0.3.tar.gz (2.5 kB view details)

Uploaded Source

File details

Details for the file django-external-urls-0.3.tar.gz.

File metadata

File hashes

Hashes for django-external-urls-0.3.tar.gz
Algorithm Hash digest
SHA256 efbc20c7773486c57702042c2dccf9799bade21dee5ef8e8745a54dc2f13fb0d
MD5 fdc8345a2c3620ea2db2682d566c121a
BLAKE2b-256 a2a5cc9b86e2abd2735fccbd13bac66902f9be0749183167f99438084f7cee3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page