This file contains hidden or 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
""" | |
Ubuntu update manager for Fabric | |
Checks for updates, installs them and reboots if needed across multiple servers | |
Create a "hosts" file alongside this fabfile and put your hosts in there one per line | |
Updating package list:: | |
fab update |
This file contains hidden or 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.conf import settings | |
from django.db.models import get_models, FileField | |
from django.core.files.storage import get_storage_class | |
STORAGE = get_storage_class(getattr(settings, "STORAGE", settings.DEFAULT_FILE_STORAGE)) | |
for model in get_models(): | |
for field in model._meta.fields: | |
if isinstance(field, FileField) and not isinstance(field.storage, STORAGE): | |
FileField(verbose_name=field.verbose_name, upload_to=field.upload_to, name=field.name).\ |
This file contains hidden or 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
NATIVE_LIBRARY = { | |
'function':{ 'add': lambda x, y: x + y }, | |
'comparison':{ 'is_in': lambda x, y: x in y }, | |
... | |
} | |
NATIVE_TAGS = ( | |
'native_tags.contrib.hash', | |
'native_tags.contrib.serializers', |
This file contains hidden or 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
def do_add(x, y): | |
return x + y | |
do_add.function = True | |
do_add.name = 'add' | |
{% add 1 9 as ten %} | |
1 + 9 = {{ ten }} | |
def less(x, y): | |
return x < y |
This file contains hidden or 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
{% ifnotequal blog.slug "belief-blog" %} | |
{% ifnotequal blog.slug "bellantoni" %} | |
{% ifnotequal blog.slug "billups" %} | |
{% ifnotequal blog.slug "blog-rings" %} | |
{% ifnotequal blog.slug "chatter" %} | |
{% ifnotequal blog.slug "d1scourse" %} | |
{% ifnotequal blog.slug "dinan" %} | |
{% ifnotequal blog.slug "fishwrap" %} | |
{% ifnotequal blog.slug "in-the-room" %} |
This file contains hidden or 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
def format_time(date_to_be_formatted, format_string): | |
return date_to_be_formatted.strftime(format_string) | |
format_time.function = True | |
format_time.filter = True | |
{% format_time entry.pub_date "%a, %d %b %Y" as pub_date %} | |
{{ entry.pub_date|format_time:"%a, %d %b %Y" }} |
This file contains hidden or 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 import template | |
register = template.Library() | |
class FormatTimeNode(template.Node): | |
def __init__(self, date_to_be_formatted, format_string): | |
self.date_to_be_formatted = template.Variable(date_to_be_formatted) | |
self.format_string = format_string |
This file contains hidden or 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
Environment: | |
Request Method: POST | |
Request URL: http://comstage.washingtontimes.com/admin/blog/entry/add/ | |
Django Version: 1.2.1 | |
Python Version: 2.6.5 | |
Installed Applications: | |
['django.contrib.auth', | |
'django.contrib.contenttypes', | |
'django.contrib.sessions', |
This file contains hidden or 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
Environment: | |
Request Method: GET | |
Request URL: http://localhost:8000/ | |
Django Version: 1.1.1 | |
Python Version: 2.6.1 | |
Installed Applications: | |
['south', | |
'wpf', | |
'nggm.cacheplus', |
This file contains hidden or 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
... | |
install_dir /Users/jquick/Projects/Python/wpf/develop-eggs/tmpBVv0pebuild | |
Generated script '/Users/jquick/Projects/Python/wpf/bin/project-content'. | |
Generated script '/Users/jquick/Projects/Python/wpf/bin/project-content.wsgi'. | |
Generated script '/Users/jquick/Projects/Python/wpf/bin/project-content.fcgi'. | |
Installing docs-epydoc. | |
Generated script '/Users/jquick/Projects/Python/wpf/bin/docs-epydoc'. | |
Installing docs-sphinx. | |
Getting distribution for 'Sphinx'. | |
Got Sphinx 0.6.3. |