- Make a virtualenv:
virtualenv env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2012, Jonas Obrist | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* * Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. | |
* * Redistributions in binary form must reproduce the above copyright | |
* notice, this list of conditions and the following disclaimer in the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Raw" picture material from Sunday-Wednesday at DjangoCon Europe 2012. By raw I mean I didn't filter out bad images, I just removed those that showed laptop screens with legible emails etc on them. | |
File Size: 5787908 Bytes | |
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Raw video material from DjangoCon Europe 2012. | |
File size: 29013548 Bytes | |
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class ChainableManager(models.Manager): | |
""" | |
A manager that allows chaining of all methods defined on it. | |
Example: | |
class MyManager(ChainableManager): | |
def active(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from deepcopy import deepcopy | |
from classytags.core import TagMeta | |
from classytags.arguments import ARgument | |
from classytags.helpers import AsTag | |
def make_as_tag(original, new_name): | |
class NewTag(AsTag, original): | |
name = new_name | |
options = deepcopy(original.options) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
In Django 1.4+ you should probably use if-elif-else-endif instead of this. | |
Usage: | |
{% switch somevar %} | |
{% case 1 %} | |
... | |
{% endcase %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.http import HttpResponse | |
from django.views.decorators.csrf import csrf_exempt | |
from django.views.decorators.http import require_POST | |
from raven.contrib.django.models import get_client | |
from registration.forms import IPNForm | |
import logging | |
import urllib2 | |
URLS = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URI, POST | |
/api/account/register | |
data = { | |
'username': '...', | |
'password': '...', | |
'email': '...', # optional | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array | |
Array.prototype.remove = function(ele){var index = this.indexOf(ele); if(index != -1){this.splice(index, 1);}}; | |
Array.prototype.copy = function(){return this.slice(0);}; | |
// String | |
String.prototype.endswith = function(suffix) {return this.indexOf(suffix, this.length - suffix.length) !== -1;}; | |
String.prototype.startswith = function(prefix) {return this.indexOf(prefix) === 0;}; | |
String.prototype.join = function(seq){return seq.join(this);}; | |
String.prototype.isdigit = function(){return !isNaN(parseInt(this));}; |