Skip to content

Instantly share code, notes, and snippets.

View adamn's full-sized avatar
☀️
It's Always Sunny in Seattle

Adam Nelson adamn

☀️
It's Always Sunny in Seattle
View GitHub Profile
@adamn
adamn / manage.py
Created November 12, 2010 16:29
Example manage.py file for using a settings/ directory
#!/usr/bin/env python
import sys
from os.path import abspath, dirname, join
from django.core.management import execute_manager
try:
from settings import active as settings
except ImportError:
sys.stderr.write("Error: Can't find the module 'active' in the directory containing %r. \
from django import template
from django.template.defaultfilters import stringfilter
register = template.Library()
@register.filter(name='prepend')
@stringfilter
def prepend(value, arg):
"""
Prepends value with arg if value exists, else returns ''