Login

Tag "google"

Snippet List

Strip Google Analytics cookies for caching middleware purposes

You may notice that using Google Analytics's 'urchin' with the CacheMiddleware and SessionMiddleware or AuthenticationMiddleware middleware classes means that nothing is ever cached. Google Analytics updates its cookies with every page view, and the Auth/Session middlewares add cookies to the caching engine's 'Vary' list. This means every page view is given a unique cache key. This middleware class will remove urchin's '__utmX' cookies from the request object before it hits the caching middleware. Put it at the top of your MIDDLEWARE_CLASSES in settings.py. nf / [email protected]

  • middleware
  • cache
  • google
  • analytics
Read More
Author: nf
  • 7
  • 13

Google Analytics Template Tag

Includes the Javascript for Google Analytics. Will not show Google Analytics code when DEBUG is on or to staff users. Use {% googleanalyticsjs %} in your templates. You must set something like GOOGLE_ANALYTICS_CODE = "UA-1234567-1" in your settings file. Assumes 'user' in your template variables is request.user, which it will be if you use: return render_to_response('template.html',{ }, context_instance=RequestContext(request)) (Assuming django.core.context_processors.auth is in TEMPLATE_CONTEXT_PROCESSORS, which it is by default)

  • google
  • urchin
  • analytics
Read More

Ping All Search Engines

Nothing much to see here. Needed this little puppy for work and figured I and others will need it for other projects. Enjoy!

  • search
  • google
  • all
  • ping
  • engines
  • yahoo
  • live
  • ask
Read More

google.js template for GoogleAdmin

JavaScript template for [GoogleAdmin](http://www.djangosnippets.org/snippets/1144/). Also requires the [google.html](http://www.djangosnippets.org/snippets/1145/) template. Install in `gis/admin` somewhere in your template path.

  • gis
  • google
  • map
  • gmaps
  • layer
  • openlayers
Read More

google.html template for GoogleAdmin

HTML template for [GoogleAdmin](http://www.djangosnippets.org/snippets/1144/). Also requires the [google.js](http://www.djangosnippets.org/snippets/1146/) template. Install in `gis/admin` somewhere in your template path.

  • gis
  • google
  • map
  • gmaps
  • layer
  • openlayers
Read More

GoogleAdmin: GMaps base layer in Geographic Admin (GeoDjango)

This GeoDjango subclass substitutes in the Google Maps base layer instead of the default one provided by Open Street Map. Requires the [google.html](http://www.djangosnippets.org/snippets/1145/) and [google.js](http://www.djangosnippets.org/snippets/1146/) templates (must be placed in `gis/admin` somewhere in your template path). Requires a Google Maps API key -- please abide by Google's [terms of service](http://code.google.com/apis/maps/terms.html).

  • gis
  • google
  • map
  • gmaps
  • layer
  • openlayers
Read More

Using Google Apps Premium infrastructure for user management

To create a lower entry barrier to logging into our intranet I created a very simple backend using Google Apps Premium provisioning API (http://code.google.com/apis/apps/gdata_provisioning_api_v2.0_reference.html). This enables controlling access for your users based on their status in your Google Apps instance. *(NOTE! Since the provisioning API is only available in the Premium version of Google Apps you first need to upgrade if you haven't done so already)* Requirements: You need Google Data libraries for python. They can be downloaded from http://code.google.com/p/gdata-python-client/downloads/list Google Apps Premium -- User used by the script must have admin rights

  • authentication
  • login
  • auth
  • google
  • google-apps
  • auth-backend
Read More

Google Charts Templatetags (Python)

The core templatetags for my project [google-chartwrapper](http://code.google.com/p/google-chartwrapper/). It is an easy method of creating dynamic GoogleCharts from the [GoogleChartAPI](http://code.google.com/apis/chart/). To get the most recent version: `svn checkout http://google-chartwrapper.googlecode.com/svn/trunk/` and run `python setup.py` in the downloaded trunk directory. There is an included django project there with the [ChartsExamples](http://code.google.com/p/google-chartwrapper/wiki/ChartExamples) all worked out in django templates

  • templatetags
  • google
  • chart
Read More

Google Charts Templatetags (HTML)

Example usage of the GChartWrapper.charts module for creating dynamic charts with templatetags. It is an easy method of creating dynamic GoogleCharts from the [GoogleChartAPI](http://code.google.com/apis/chart/). The project is located at [google-chartwrapper](http://code.google.com/p/google-chartwrapper/). To get the most recent version: `svn checkout http://google-chartwrapper.googlecode.com/svn/trunk/` and run `python setup.py` in the downloaded trunk directory. There is an included django project there with the [ChartsExamples](http://code.google.com/p/google-chartwrapper/wiki/ChartExamples) all worked out in django templates

  • templatetags
  • google
  • chart
Read More

Google Contacts API friend finder

This view will provide a link for AuthSub proxy authentication to the Google Contacts API and then grab the user's Google contacts and compare against User.email for possible user relationships. A couple of things to note: * Dependency on the GData Python client library: http://code.google.com/p/gdata-python-client/ * The domain hosting the view must be verified by Google's domain manager (otherwise API calls will result in a 403): https://www.google.com/accounts/ManageDomains Thanks to Simon for get_url_host and get_full_url.

  • api
  • gmail
  • google
  • gdata
  • contacts
Read More

widget to capture a geographic Point

The class LocationField renders a form field with map (from google maps) and a mark. It allows the user to drag the mark to point at some particular location, whose value (lat, lng) is saved in a hidden field. It requires jquery and google maps.

  • newforms
  • forms
  • gis
  • google
  • field
  • maps
  • widget
Read More

Search djangosnippets.org

I was tired browsing via tag to find snippets I saw a while ago. So I created a custom search engine with Google. To try it out go to [http://henning.cco-ev.de/django/djangosnippets.html](http://henning.cco-ev.de/django/djangosnippets.html)

  • snippets
  • search
  • google
  • snippet
  • djangosnippets
  • cse
Read More

Get Latitude and Longitude from google maps

I use this to integrate a google map in a form renderd by newforms. If someone click on the map and set a icon, the Latitude and Longitude data goes into the 2 form fields. You need to generate a google API key (http://www.google.com/apis/maps/signup.html) for the GOOGLE_KEY variable.

  • google
  • latitude
  • longitude
  • googlemaps
Read More
Author: b23
  • 1
  • 14

31 snippets posted so far.