Moved to http://manfre.github.com/talk-process-apache-windows/
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
# 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' | |
}, | |
}, |
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
{$MICROBIN_EXTERNAL_DNS:paste.myapp.local} { | |
# always forward outpost path to actual outpost | |
reverse_proxy /outpost.goauthentik.io/* {$AUTHENTIK_CONTAINER_NAME:authentik-server-1}:{$AUTHENTIK_PORT:9000} | |
# forward authentication to outpost | |
forward_auth {$AUTHENTIK_CONTAINER_NAME:authentik-server-1}:{$AUTHENTIK_PORT:9000} { | |
uri /outpost.goauthentik.io/auth/caddy | |
# capitalization of the headers is important, otherwise they will be empty |
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
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 |
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
class ComputedFieldsManager(models.Manager): | |
""" | |
Manager that can account for computed fields and fetch those fields, but | |
ensure they are not writeable. | |
Example usage: | |
objects = ComputedFieldsManager(computed_fields=['my_computed_field']) | |
objects = ComputedFieldsManager(computed_fields=[('my_computed_field', models.BooleanField())]) |
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
class ItemGroup(models.Model): | |
name = models.CharField(max_length=10) | |
group_type = models.CharField(max_length=10, default='test') | |
class Item(models.Model): | |
group = models.ForeignKey(ItemGroup, | |
related_name='items', | |
limit_choices_to={ | |
'group_type__in': ('test'), |
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
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: |
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
====================================================================== | |
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' | |
---------------------------------------------------------------------- |
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
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): |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
NewerOlder