Skip to content

Instantly share code, notes, and snippets.

View stefanfoulis's full-sized avatar

Stefan Foulis stefanfoulis

View GitHub Profile
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/cms/page/3/edit-plugin/27/
Django Version: 1.5c1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/filer/folder/
Django Version: 1.5c1
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/filer/folder/8/list/
Django Version: 1.6.dev20130123004615
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
@stefanfoulis
stefanfoulis / chainable_manager.py
Created November 9, 2012 13:56 — forked from ojii/chainable_manager.py
Django Model Managers
from django.db import models
from django.db.models.query import QuerySet
class ChainableManager(models.Manager):
"""
A manager that allows chaining of all methods defined on it.
Example:
class MyManager(ChainableManager):
"""
Collects as much information as possible from ENV for auto-configuration.
Individual items should actually be exported from here and integrated into heroku-buildpack-python
"""
from stefanfoulis.settings import *
import os
def sentry_config(default='', env='SENTRY_DSN'):
"""alter settings from SENTRY_DSN."""
return os.environ.get(env, default)
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAstk2DWscjksvanWXwH93ED3rkbqWP1VCnv4x3Vd3kRu4VYU8xwLHQB50Xy3iacBsBtTj6vajCL2AawSYVeZcRW4ptOvr89ZgoHY5K4DytWFYoG1fnzpcfz3A243iOZZLR9CmYn0V3i5k1h3Xn32Q9cC1MxiMCvpUmFLjUfRfXvv8nX1WDX6A6MhT/+D+s/ZcO6i/35qT5cTVazxdl+WznFUsriV4qdiVn+AQRxJH7LeHYWhXAGwwP0lsSc4vMZv57KExWQx7Pt/v7ZO9lSJTm84h5aKmbj8lKVP9wJ0gUVPdcgx3SCs0rTeCvVoQfx7Sh8fSMBvf8drVNmQ/eJNWrQ== stefan@foulis.ch
@stefanfoulis
stefanfoulis / server_base.py
Created February 22, 2012 16:43
debug_fileserver.py
#-*- coding: utf-8 -*-
import os
import stat
from django.http import Http404, HttpResponse, HttpResponseNotModified
from django.utils.http import http_date
from django.views.static import was_modified_since
from base import ServerBase
class DefaultServer(ServerBase):
'''
"""
Just a quick hack to collect all "media" directories in INSTALLED_APPS instead
of only the "static" directories.
add this to your settings:
STATICFILES_FINDERS = (
"django.contrib.staticfiles.finders.FileSystemFinder",
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
"myproject.media_staticfiles_finder.AppDirectoriesFinderAsMedia",

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.