Example #1
0
    email_logger.register_logger('*****@*****.**')        
"""
 
import hashlib
import logging
import os
import sys
from google.appengine.runtime.apiproxy_errors import OverQuotaError
from django.core.mail.message import EmailMultiAlternatives
from django.views.debug import ExceptionReporter
from spudmart.utils.app_identity import get_spudmart_app_name

LOG_FORMAT = '%(levelname)-8s %(asctime)s %(filename)s:%(lineno)s] %(message)s'
MAX_SIGNATURE_LENGTH = 256

app_id = get_spudmart_app_name()
app_ver = os.environ.get('CURRENT_VERSION_ID')


class EmailLoggingHandler(logging.Handler):
    """A handler that sends log messages out over XMPP.    
    """
 
    def __init__(self, recipients, log_interval=350, log_level=logging.NOTSET):
        """
        Constructs a new EmailLoggingHandler.
        
        @param recipients: can be email address, 
                           list of email addresses, 
                           tuple ('email_address', logging_level), 
                           or dictionary {'email_address':logging_level, ...}
Example #2
0
    email_logger.register_logger('*****@*****.**')        
"""

import hashlib
import logging
import os
import sys
from google.appengine.runtime.apiproxy_errors import OverQuotaError
from django.core.mail.message import EmailMultiAlternatives
from django.views.debug import ExceptionReporter
from spudmart.utils.app_identity import get_spudmart_app_name

LOG_FORMAT = '%(levelname)-8s %(asctime)s %(filename)s:%(lineno)s] %(message)s'
MAX_SIGNATURE_LENGTH = 256

app_id = get_spudmart_app_name()
app_ver = os.environ.get('CURRENT_VERSION_ID')


class EmailLoggingHandler(logging.Handler):
    """A handler that sends log messages out over XMPP.    
    """
    def __init__(self, recipients, log_interval=350, log_level=logging.NOTSET):
        """
        Constructs a new EmailLoggingHandler.
        
        @param recipients: can be email address, 
                           list of email addresses, 
                           tuple ('email_address', logging_level), 
                           or dictionary {'email_address':logging_level, ...}
        @param log_interval: How long before a log entry will generate another message.
Example #3
0
import logging
import os
import mimetypes
from djangoappengine.settings_base import *
from spudderadmin.templatetags.featuretags import feature_is_enabled
from spudmart.utils.app_identity import get_spudmart_app_name

# Activate django-dbindexer for the default database

DATABASES["native"] = DATABASES["default"]
DATABASES["default"] = {"ENGINE": "dbindexer", "TARGET": "native", "HIGH_REPLICATION": True}
AUTOLOAD_SITECONF = "indexes"

app_name = get_spudmart_app_name()


class Environments:
    LIVE = "live"
    STAGE = "stage"
    DEV = "dev"


ENVIRONMENT = Environments.DEV
DEBUG = True

if app_name in ["livespudder"]:
    ENVIRONMENT = Environments.LIVE
    DEBUG = False
elif app_name in ["spudmart1"] and not os.environ.get("SERVER_SOFTWARE", "").startswith("Development"):
    ENVIRONMENT = Environments.STAGE
import mimetypes
from djangoappengine.settings_base import *
from spudderadmin.templatetags.featuretags import feature_is_enabled
from spudmart.utils.app_identity import get_spudmart_app_name

# Activate django-dbindexer for the default database

DATABASES['native'] = DATABASES['default']
DATABASES['default'] = {
    'ENGINE': 'dbindexer',
    'TARGET': 'native',
    'HIGH_REPLICATION': True
}
AUTOLOAD_SITECONF = 'indexes'

app_name = get_spudmart_app_name()


class Environments:
    LIVE = 'live'
    STAGE = 'stage'
    DEV = 'dev'


ENVIRONMENT = Environments.DEV
DEBUG = True

if app_name in ['livespudder']:
    ENVIRONMENT = Environments.LIVE
    DEBUG = False
elif app_name in [