Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Django Docs Banner removal
// @namespace http://use.i.E.your.homepage/
// @version 0.0.2
// @description Removes the annoying "dev-warning" at the top of the website.
// @include https://docs.djangoproject.com/*/dev/
// @copyright 2013+, Jeff Triplett
// ==/UserScript==
@fcurella
fcurella / authentication.py
Created November 8, 2012 20:58 — forked from vmihailenco/authentication.py
Tastypie OAuth
import logging
from tastypie.authentication import Authentication
import oauth2
from oauth_provider.consts import OAUTH_PARAMETERS_NAMES
from oauth_provider.store import store
from oauth_provider.store import Error as OAuthError
from oauth_provider.utils import get_oauth_request
from oauth_provider.utils import get_oauth_server
@fcurella
fcurella / gist:976625
Created May 17, 2011 14:56 — forked from putermancer/gist:591964
Set up a local solr instance on mac
# Setting up a local solr instance on a mac
# install solr with homebrew
brew install solr
# create the base solr index directory
mkdir -p /data/solr
# make sure you can write to the solr logs
sudo chown -R `whoami` /usr/local/Cellar/solr/
"""
Straight Include template tag by @HenrikJoreteg
Django templates don't give us any way to escape template tags.
So if you ever need to include client side templates for ICanHaz.js (or anything else that
may confuse django's templating engine) You can is this little snippet.
Just use it as you would a normal {% include %} tag. It just won't process the included text.
# -*- coding: utf-8 -*-
import datetime
from django.http import HttpResponse
from django.utils import simplejson
from django.shortcuts import render_to_response
from django.template import RequestContext
class DateTimeJSONEncoder(simplejson.JSONEncoder):
"""
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the