Skip to content

Instantly share code, notes, and snippets.

View 235's full-sized avatar

Oleksandr Pryymak 235

View GitHub Profile
@235
235 / crawl_tweets.py
Created March 1, 2014 23:43
Tweets from streaming API
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from tweepy.streaming import StreamListener
from tweepy import Stream, OAuthHandler
######## Application settings
## API key
@235
235 / disable_csrf.py
Created October 4, 2012 18:24
Django: Disables CSRF for the whole project to simplify prototyping, unsecure in production
""" Disables CSRF for the whole project to simplify prototyping, unsecure in production """
class DisableCSRF(object):
#def process_view(self, request, callback, callback_args, callback_kwargs):
def process_request(self, request):
setattr(request, '_dont_enforce_csrf_checks', True)
### === Add to settings.py:
#==============================================================================