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.shortcuts import render_to_response | |
from django.template import RequestContext | |
from django.views.decorators.csrf import csrf_exempt | |
from django.http import HttpResponse | |
from django.core.files.storage import default_storage | |
from django.core.files.base import ContentFile | |
from django.conf import settings | |
from django.shortcuts import render | |
import json | |
import md5 |
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
# ~/.pypirc | |
find_links = http://localhost/pypi/ |
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
<?xml version="1.0"?> | |
<root> | |
<list> | |
<item> | |
<name>Swap Space and Tab</name> | |
<identifier>private.swap_space_and_tab</identifier> | |
<autogen>--KeyToKey-- KeyCode::SPACE, KeyCode::TAB</autogen> | |
<autogen>--KeyToKey-- KeyCode::TAB, KeyCode::SPACE</autogen> | |
</item> | |
<item> |
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
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.sqlite3' | |
}, | |
'other': { | |
'ENGINE': 'django.db.backends.sqlite3', | |
'TEST_NAME': 'other_db' | |
} | |
} |
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
"Memcached cache backend" | |
import time | |
from django.conf import settings | |
from django.core.cache.backends.base import BaseCache, InvalidCacheBackendError | |
from django.utils.encoding import smart_unicode, smart_str | |
class CacheClass(BaseCache): | |
def __init__(self, server, params): |
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
# internal publish endpoint (keep it private / protected) | |
location /publish { | |
set $push_channel_id $arg_id; #/?id=239aff3 or somesuch | |
push_publisher; | |
push_store_messages on; # enable message queueing | |
push_message_timeout 2h; # expire buffered messages after 2 hours | |
push_max_message_buffer_length 10; # store 10 messages | |
push_min_message_recipients 0; # minimum recipients before purge | |
} |
NewerOlder