djangosnippets.org: Latest snippets tagged with 'google'https://djangosnippets.org/tags/google/2015-05-17T20:31:21.974850-05:00Google URL Shortner using Python requests
2015-05-17T20:31:21.974850-05:00akshayw39https://djangosnippets.org/snippets/10486/<p>This code can convert a url to short url using google URL Shortener API https://developers.google.com/url-shortener/v1/getting_started </p>
Freely redistributableUse django-social-auth & Google Accounts for admin login
2012-12-04T09:27:39.814163-06:00pmdarrowhttps://djangosnippets.org/snippets/2856/<ol>
<li>Create an app and place this in <code>admin.py</code>. </li>
<li>Add <code>url(r'^login/$', 'social_auth.views.auth', {'backend': 'google'}, name='login')</code> to your <code>urls.py</code>.</li>
<li>Add the app to your <code>INSTALLED_APPS</code> after <code>django.contrib.admin</code>. </li>
<li>Set <code>USE_SOCIAL_AUTH_AS_ADMIN_LOGIN = True</code> in your <code>settings.py</code>.</li>
<li>...</li>
<li>Profit.</li>
</ol>
Freely redistributableiCal for Google Calendar
2012-01-28T04:29:22.976879-06:00TrevorPhttps://djangosnippets.org/snippets/2666/<p>This code publishes an iCal file that can be subscribed to in Google Calendar. They change the way they interpret iCal data occasionally, so this may break, I'll try to keep it up to date.</p>
<p>There is some crazy string replace stuff going on there, I haven't yet convinced vObject …</p>
Freely redistributableGet Lat Lng From Google Maps
2011-03-23T00:39:21.224573-05:00dodolbokshttps://djangosnippets.org/snippets/2399/<p>example</p>
<p>import get_lat
loc="jl perjuangan by pass sunyaragi cirebon</p>
<blockquote>
<blockquote>
<blockquote>
<p>get_lat(loc)
-6.734402 - 108.556878
</p>
</blockquote>
</blockquote>
</blockquote>
Freely redistributableShare button
2011-01-14T19:00:19.427246-06:00carlosvinhttps://djangosnippets.org/snippets/2323/<p>This template can be included by other template passing the vars page_url and title:
{% with content.get_url as page_url %}
{% with content.title as title %}
{% include 'share.html' %}
{% endwith %}
{% endwith %} </p>
Freely redistributableRetrieve Latitude & Longitude for an Address from Google Geocoder V3
2010-10-25T12:18:51.392771-05:00whardemanhttps://djangosnippets.org/snippets/2241/<p>Very simple python class for querying Google Geocoder. Accepts a human-readable address, parses JSON results and sets lat and lng. (Full JSON results are stored to <code>results</code> property of GoogleLatLng for access to other attributes.)</p>
<p>This could easily be expanded to include the XML output option, etc.</p>
<p><strong>Requires PycURL and …</strong></p>
Freely redistributableGenerate Google Calendar links from django-event-calendar
2010-10-06T19:03:10.313313-05:00ElfSternberghttps://djangosnippets.org/snippets/2224/<p>This very simple templatetag can take event objects from django-event-calendar and create the appropriate URLs to automatically allow users to add events from your website to Google calendar.</p>
Freely redistributableGoo.gl URL shortener
2010-10-05T01:40:32.271536-05:00aabelehttps://djangosnippets.org/snippets/2220/<p>A function, that converts url into goo.gl link.
</p>
Freely redistributableDjango google maps v3 snipplet
2010-07-14T05:10:50.259366-05:00summerisgonehttps://djangosnippets.org/snippets/2106/<p>Almost copied from snipplet http://djangosnippets.org/snippets/752/, but I used Google Maps API v3</p>
Freely redistributablePython Google Translate AJAX module
2010-02-22T13:42:21.656787-06:00vsergeyevhttps://djangosnippets.org/snippets/1934/<p>Based on http://code.google.com/p/py-gtranslate/</p>
<p>Removed YAML dependency and list of languages.
Instead it use 2-symbol codes for languages.</p>
Freely redistributableGoogle Authentification
2010-01-31T15:26:13.226564-06:00marcossousahttps://djangosnippets.org/snippets/1904/<p>Google autentication</p>
Freely redistributableWeb crawler/bot detection and blocking middleware
2010-01-13T15:11:33.774669-06:00haloweenhttps://djangosnippets.org/snippets/1865/<p>Sets request.is_crawler</p>
<p>Allow bot lockout from certain urls in urlconf ,add view parameter 'deny_crawlers'</p>
<p>ex.</p>
<p>url(r'^foo/$', 'views.foo',{'deny_crawlers' : True},name='foo')</p>
<p>view param is removed after middleware pass.</p>
Freely redistributablerss news
2009-11-28T05:00:00.454252-06:00montaohttps://djangosnippets.org/snippets/1821/<p>publish tldrelative rss news exampled web.montao.com.br/li</p>
Freely redistributableImageField for Google App Engine
2009-11-17T12:46:21.682897-06:00davepeckhttps://djangosnippets.org/snippets/1805/<p>This is a replacement for Django's built-in ImageField. It uses the Google AppEngine image APIs in order to validate. </p>
<p>Notes:</p>
<ol>
<li>Validation of the field counts against your App Engine transformations quota.</li>
<li>This code assumes you're only using the in-memory file upload handler. None of the other stock handlers work well …</li></ol>
Freely redistributableGoogle Closure support in django-compress
2009-11-06T03:09:07.307181-06:00fabrice.bonnyhttps://djangosnippets.org/snippets/1785/<p>A filter to integrate Google Closure compiler in django-compress plugin.
</p>
<ol>
<li>
<a href="http://code.google.com/p/django-compress/">download django-compress</a>
</li>
<li>
install it
</li>
<li>
<a href="http://code.google.com/closure/compiler">download Closure Compiler</a>
</li>
<li>
put the jar at the root of your project
</li>
<li>
put this snippet as a <strong><strong>init</strong>.py</strong> file in a <strong>google_closure</strong> directory in the filters directory of the plugin
</li>
<li>
add <code>COMPRESS_JS_FILTERS = ('compress.filters.google_closure.GoogleClosureCompilerFilter',)</code> to …</li></ol>
Freely redistributable