johnboxall / django-mobileadsense

Django utilites for using Google AdSense for Mobile.

This URL has Read+Write access

name age message
file .gitignore Mon Sep 28 09:38:10 -0700 2009 Initial import. [johnboxall]
file README.txt Mon Sep 28 09:38:10 -0700 2009 Initial import. [johnboxall]
file __init__.py Mon Sep 28 09:38:10 -0700 2009 Initial import. [johnboxall]
file adsense.py Mon Sep 28 09:38:10 -0700 2009 Initial import. [johnboxall]
file models.py Mon Sep 28 09:38:10 -0700 2009 Initial import. [johnboxall]
directory templatetags/ Mon Sep 28 09:38:10 -0700 2009 Initial import. [johnboxall]
file tests.py Mon Sep 28 09:38:10 -0700 2009 Initial import. [johnboxall]
README.txt
Helpers for using Google AdSense for Mobile in a Django app.


USAGE:

1) Add `adsense` into your INSTALLED_APPS:

    INSTALLED_APPS = [..., "adsense", ...]

2) Display an ad:

    from adsense.adsense import adsense

    def view(request):
        adsense_publisher_id = "get-from-google"
        ad = adsense(request, adsense_publisher_id, timeout=1, fail_silently=True)
        return HttpResponse(ad)
        
3) Or in a template:

    {% load adsense_tags %}
    
    <p>Fabulous content.</p>
    {% adsensemobile "adsense_publisher_id" %}