Login

Tag "google"

Snippet List

Use django-social-auth & Google Accounts for admin login

1. Create an app and place this in `admin.py`. 2. Add `url(r'^login/$', 'social_auth.views.auth', {'backend': 'google'}, name='login')` to your `urls.py`. 3. Add the app to your `INSTALLED_APPS` after `django.contrib.admin`. 4. Set `USE_SOCIAL_AUTH_AS_ADMIN_LOGIN = True` in your `settings.py`. 5. ... 6. Profit.

  • admin
  • login
  • auth
  • google
  • openid
  • django-social-auth
Read More

iCal for Google Calendar

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. There is some crazy string replace stuff going on there, I haven't yet convinced vObject to format things properly. Feedback welcome. *Note: this works for my existing feeds, but if I add a new feed to GCal, the timezones are incorrect, I'm working on that.

  • calendar
  • timezone
  • google
  • publish
  • ical
  • subscribe
Read More

Share button

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 %}

  • google
  • facebook
  • twitter
  • html5
  • linkedin
  • reader
  • share
Read More

Retrieve Latitude & Longitude for an Address from Google Geocoder V3

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 `results` property of GoogleLatLng for access to other attributes.) This could easily be expanded to include the XML output option, etc. **Requires PycURL and simplejson.** Example: >>> location = "1600 Amphitheatre Parkway, Mountain View, CA 94043" >>> glatlng = GoogleLatLng() >>> glatlng.requestLatLngJSON(location) >>> print "Latitude: %s, Longitude: %s" % (glatlng.lat, glatlng.lng) Latitude: 37.422782, Longitude: -122.085099` ** Do not forget the usage limits, which include request rate throttling, otherwise, Google might ban you. ** ===

  • google
  • geocode
Read More

Web crawler/bot detection and blocking middleware

Sets request.is_crawler Allow bot lockout from certain urls in urlconf ,add view parameter 'deny_crawlers' ex. url(r'^foo/$', 'views.foo',{'deny_crawlers' : True},name='foo') view param is removed after middleware pass.

  • middleware
  • bot
  • google
  • yahoo
  • crawler
  • robot
  • googlebot
  • cuil
  • slurp
Read More

rss news

publish tldrelative rss news exampled web.montao.com.br/li

  • rss
  • google
  • app
  • gae
  • engine
  • news
Read More

ImageField for Google App Engine

This is a replacement for Django's built-in ImageField. It uses the Google AppEngine image APIs in order to validate. Notes: 1. Validation of the field counts against your App Engine transformations quota. 2. This code assumes you're only using the in-memory file upload handler. None of the other stock handlers work well on App Engine; you should probably disable them.

  • fields
  • imagefield
  • google
  • appengine
  • gae
Read More

Google Closure support in django-compress

A filter to integrate Google Closure compiler in django-compress plugin. 1. [download django-compress](http://code.google.com/p/django-compress/) 2. install it 3. [download Closure Compiler](http://code.google.com/closure/compiler) 4. put the jar at the root of your project 5. put this snippet as a **__init__.py** file in a **google_closure** directory in the filters directory of the plugin 6. add `COMPRESS_JS_FILTERS = ('compress.filters.google_closure.GoogleClosureCompilerFilter',)` to your settings.py You can test `COMPRESS_CLOSURE_JS_ARGUMENTS = {'compilation_level': 'ADVANCED_OPTIMIZATIONS', }` in your settings.py too

  • google
  • js
  • minify
  • closure
  • compress
Read More

31 snippets posted so far.