Skip to content

Instantly share code, notes, and snippets.

from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
class RestrictedView(APIView):
permission_classes = (IsAuthenticated, )
authentication_classes = (JSONWebTokenAuthentication, )
eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9
@jpadilla
jpadilla / gist:8468419
Created January 17, 2014 04:26
List of free email provider domains that responded to a ping.
123box.net
150ml.com
123qwe.co.uk
163.com
1funplace.com
1internetdrive.com
1under.com
1webave.com
24horas.com
2bmail.co.uk
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
@jpadilla
jpadilla / exceptions.py
Created January 15, 2014 00:41
Custom exception handler for Django Rest Framework that adds the `status_code` to the response and renames the `detail` key to `error`.
from rest_framework.views import exception_handler
def custom_exception_handler(exc):
"""
Custom exception handler for Django Rest Framework that adds
the `status_code` to the response and renames the `detail` key to `error`.
"""
response = exception_handler(exc)
$ tree -I *.pyc
.
├── README.md
├── blimp2_api
│   ├── __init__.py
│   ├── __init__.pyc
│   ├── authentication.pyc
│   ├── permissions.py
│   ├── permissions.pyc
│   ├── renderers.pyc
(function () {
var COMPILED = !0,
goog = goog || {};
goog.global = this;
goog.DEBUG = !0;
goog.LOCALE = "en";
goog.provide = function (a) {
if (!COMPILED) {
if (goog.isProvided_(a)) throw Error('Namespace "' + a + '" already declared.');
delete goog.implicitNamespaces_[a];
New python executable in lift/bin/python
Installing setuptools, pip...
Complete output from command /home/ubuntu/.virtualenvs/lift/bin/python -c "import sys, pip; pip...ll\"] + sys.argv[1:])" setuptools pip:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-1.5-py2.py3-none-any.whl/pip/__init__.py", line 11, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-1.5-py2.py3-none-any.whl/pip/vcs/subversion.py", line 4, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-1.5-py2.py3-none-any.whl/pip/index.py", line 16, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-1.5-py2.py3-none-any.whl/pip/wheel.py", line 23, in <module>
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-1.5-py2.py3-none-any.whl/pip/_vendor/distlib/scripts.py", line 15, in <module>
echo "hello world"
echo "$1"
import urllib
import requests
client_id = '...'
client_secret = '...'
site = 'https://sopr.herokuapp.com'
redirect_uri = '...'
oauth_params = {