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
""" | |
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) |
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
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): |
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
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', |
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
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', |
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
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', |
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
# -*- coding: utf-8 -*- | |
import requests | |
import json | |
import pprint | |
from secrets import hipchat_api_key # the hipchat API key with admin rights | |
from secrets import github_credentials # a tuple for github access (github_username, password), | |
from secrets import hipchat_notification_api_key # the hipchat API key to use for the notification hooks on github | |
hipchat_apps_room_name = 'Divio Application Suite' |
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
<script type="text/javascript" src="http://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
google.load("maps", "3.x", {callback: initialize, other_params:'sensor=false&libraries=places'}); | |
function initialize() { | |
var input = document.getElementById('id_location'); | |
var autocomplete = new google.maps.places.Autocomplete(input, { types: ['(cities)'], region:'EU' }); | |
google.maps.event.addListener(autocomplete, 'place_changed', function() { | |
var place = autocomplete.getPlace(); | |
if (!place.geometry) { |
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
# -*- coding: utf-8 -*- | |
from django.utils.translation import get_language, activate, deactivate_all, deactivate | |
class LanguageFieldProxy(object): | |
def contribute_to_class(self, cls, name): | |
self.name = name | |
setattr(cls, self.name, self) | |
def __get__(self, instance, instance_type=None): |
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
# -*- coding: utf-8 -*- | |
"""Refactor South migrations to use settings.AUTH_USER_MODEL. | |
Inserts a backwards-compatible code-snippet in all | |
your schema migration files and uses a possibly customized user | |
model as introduced in Django 1.5. | |
Please note that this has nothing to do with changing | |
settings.AUTH_USER_MODEL to a new model. If you do this, stuff | |
will very likely break in reusable apps that have their own | |
migration trees. |