Presented by Michael Manfre
www.src.org, a case study of running Django in a Windows environment. This talk will describe the Semiconductor Research Corporation's (SRC) website,
# Example logging configuration that will restrict console logging to | |
# at most 2 repeated messages per 30 seconds. | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': True, | |
'formatters': { | |
'simple': { | |
'format': '%(asctime)s - %(name)s - %(levelname)s - %(filename)s:%(lineno)d - %(message)s' | |
}, | |
}, |
#!/usr/bin/env python | |
""" | |
Use pip to get a list of local packages to check against one or more package | |
indexes for updated versions. | |
""" | |
import sys | |
import xmlrpclib | |
import subprocess | |
from distutils.version import StrictVersion, LooseVersion |
from django.http import HttpResponse | |
from django.template import RequestContext | |
from django.template.loader import render_to_string | |
from django.utils.decorators import available_attrs | |
import waffle | |
def waffled_view(function=None, flag=None, template='503-waffled.html', **kwargs): | |
""" | |
Check the decorated view to see if the flag is enabled for the current | |
request. Any kwargs will be made available to the template. |
Presented by Michael Manfre
www.src.org, a case study of running Django in a Windows environment. This talk will describe the Semiconductor Research Corporation's (SRC) website,
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
import logging, os, os.path, re | |
from hashlib import md5 | |
from django.http import Http404, HttpResponse, HttpResponseForbidden, HttpResponseNotFound, HttpResponseRedirect, HttpResponseNotModified | |
from django.conf import settings | |
from django.core.servers.basehttp import FileWrapper | |
from django.core.urlresolvers import reverse, NoReverseMatch | |
from django.utils.encoding import smart_str | |
from django.utils.http import http_date | |
from django.core.cache import cache |
class SQLCompiler(compiler.SQLCompiler): | |
def resolve_columns(self, row, fields=()): | |
# If the results are sliced, the resultset will have an initial | |
# "row number" column. Remove this column before the ORM sees it. | |
if getattr(self, '_using_row_number', False): | |
row = row[1:] | |
values = [] | |
index_extra_select = len(self.query.extra_select.keys()) | |
for value, field in map(None, row[index_extra_select:], fields): |
====================================================================== | |
FAIL: test_templates (template_tests.tests.TemplateTests) | |
---------------------------------------------------------------------- | |
Traceback (most recent call last): | |
File "C:\projects\django\django\tests\template_tests\tests.py", line 621, in test_templates | |
('-'*70, ("\n%s\n" % ('-'*70)).join(failures))) | |
AssertionError: Tests failed: | |
---------------------------------------------------------------------- | |
Template test (Cached='False', TEMPLATE_STRING_IF_INVALID='', TEMPLATE_DEBUG=False): filter-timeuntil10 -- FAILED. Expected u'0\xa0minutes', got u'59\xa0minutes' | |
---------------------------------------------------------------------- |
class SubqueryTests(TestCase): | |
def setUp(self): | |
DumbCategory.objects.create(id=1) | |
DumbCategory.objects.create(id=2) | |
DumbCategory.objects.create(id=3) | |
DumbCategory.objects.create(id=4) | |
def test_ordered_subselect(self): | |
"Subselects honor any manual ordering" | |
try: |