コード例 #1
0
def logfile_handler(filename, debug=False, **kwargs):
    config = {
        'filename': join_path(LOG_FOLDER, filename),
        'filters': ['require_debug_true'] if debug else ['require_debug_false'],
        'level': 'DEBUG' if debug else 'WARNING',
        'class': 'logging.FileHandler',
        'formatter': 'verbose',
    }
    config.update(kwargs)
    return config
コード例 #2
0
def logfile_handler(filename, debug=False, **kwargs):
    config = {
        'filename': join_path(LOG_FOLDER, filename),
        'filters': ['debug_on'] if debug else ['debug_off'],
        'level': 'DEBUG' if debug else 'WARNING',
        'class': 'logging.FileHandler',
        'formatter': 'verbose',
    }
    config.update(kwargs)
    return config
コード例 #3
0
# -*- coding: utf-8 -*-
"""Configurations for logging"""
from utils.setting_helpers import environment_variable, join_path
__all__ = ['LOGGING']

LOG_FOLDER = join_path(environment_variable('SOURCE_FOLDER'), '..', 'logs')


def logfile_handler(filename, debug=False, **kwargs):
    config = {
        'filename': join_path(LOG_FOLDER, filename),
        'filters': ['require_debug_true'] if debug else ['require_debug_false'],
        'level': 'DEBUG' if debug else 'WARNING',
        'class': 'logging.FileHandler',
        'formatter': 'verbose',
    }
    config.update(kwargs)
    return config

LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
}
LOGGING['filters'] = {
    'require_debug_false': {
        '()': 'django.utils.log.RequireDebugFalse'
    },
    'require_debug_true': {
        '()': 'django.utils.log.RequireDebugTrue'
    }
}
コード例 #4
0
                'max_connections': 50,
                'timeout': 20,
            }
        },
    },
}

# FOLDERS
# source code folder
BASE_DIR = environment_variable('SOURCE_FOLDER')
# outside of repo
PROJECT_DIR = dirname(BASE_DIR)

# Django puts generated translation files here.
LOCALE_PATHS = [
    join_path(BASE_DIR, 'translation'),
]
# Extra path to collect static assest such as javascript and css
STATICFILES_DIRS = [
    join_path(PROJECT_DIR, 'build'),
]
# Project wide fixtures to be loaded into database.
FIXTURE_DIRS = [
    join_path(BASE_DIR, 'fixtures'),
]
# Project wide django template files
# Look for byline images here
BYLINE_PHOTO_DIR = '/srv/fotoarkiv_universitas/byline/'
STAGING_ROOT = '/srv/fotoarkiv_universitas/'

# INTERNATIONALIZATION
コード例 #5
0
                'max_connections': 50,
                'timeout': 20,
            }
        },
    },
}

# FOLDERS
# source code folder
BASE_DIR = environment_variable('SOURCE_FOLDER')
# outside of repo
PROJECT_DIR = dirname(BASE_DIR)


# Django puts generated translation files here.
LOCALE_PATHS = [join_path(BASE_DIR, 'translation'), ]
# Extra path to collect static assest such as javascript and css
STATICFILES_DIRS = [
    join_path(PROJECT_DIR, 'build'),
]
# Project wide fixtures to be loaded into database.
FIXTURE_DIRS = [join_path(BASE_DIR, 'fixtures'), ]
# Project wide django template files
# Look for byline images here
BYLINE_PHOTO_DIR = '/srv/fotoarkiv_universitas/byline/'
STAGING_ROOT = '/srv/fotoarkiv_universitas/'


# INTERNATIONALIZATION
LANGUAGE_CODE = 'nb'
LANGUAGES = [
コード例 #6
0
STATIC_ROOT = 'static'
MEDIA_ROOT = 'media'
# STATICFILES_STORAGE = 'utils.aws_custom_storage.StaticStorage'
# DEFAULT_FILE_STORAGE = 'utils.aws_custom_storage.MediaStorage'
# THUMBNAIL_STORAGE = 'utils.aws_custom_storage.ThumbStorage'

# FOLDERS
# source code folder
BASE_DIR = environment_variable('SOURCE_FOLDER')
# outside of repo
PROJECT_DIR = dirname(BASE_DIR)

# GULP FILE REVISIONS
GULP_FILEREVS = load_json_file(
    join_path(PROJECT_DIR, 'build', 'rev-manifest.json'))

# Django puts generated translation files here.
LOCALE_PATHS = [
    join_path(BASE_DIR, 'translation'),
]
# Extra path to collect static assest such as javascript and css
STATICFILES_DIRS = [
    join_path(PROJECT_DIR, 'build'),
]
# Project wide fixtures to be loaded into database.
FIXTURE_DIRS = [
    join_path(BASE_DIR, 'fixtures'),
]
# Project wide django template files
TEMPLATE_DIRS = [
コード例 #7
0
ファイル: base.py プロジェクト: haakenlid/prodsys2
STATIC_ROOT = 'static'
MEDIA_ROOT = 'media'
# STATICFILES_STORAGE = 'utils.aws_custom_storage.StaticStorage'
# DEFAULT_FILE_STORAGE = 'utils.aws_custom_storage.MediaStorage'
# THUMBNAIL_STORAGE = 'utils.aws_custom_storage.ThumbStorage'

# FOLDERS
# source code folder
BASE_DIR = environment_variable('SOURCE_FOLDER')
# outside of repo
PROJECT_DIR = dirname(BASE_DIR)

# GULP FILE REVISIONS
GULP_FILEREVS = load_json_file(
    join_path(PROJECT_DIR, 'build', 'rev-manifest.json'))

# Django puts generated translation files here.
LOCALE_PATHS = [join_path(BASE_DIR, 'translation'), ]
# Extra path to collect static assest such as javascript and css
STATICFILES_DIRS = [join_path(PROJECT_DIR, 'build'), ]
# Project wide fixtures to be loaded into database.
FIXTURE_DIRS = [join_path(BASE_DIR, 'fixtures'), ]
# Project wide django template files
TEMPLATE_DIRS = [join_path(BASE_DIR, 'templates'), ]
# Look for byline images here
BYLINE_PHOTO_DIR = '/srv/fotoarkiv_universitas/byline/'
STAGING_ROOT = '/srv/fotoarkiv_universitas/'


# INTERNATIONALIZATION
コード例 #8
0
# -*- coding: utf-8 -*-
"""Configurations for logging"""
from utils.setting_helpers import environment_variable, join_path
__all__ = ['LOGGING']

LOG_FOLDER = join_path(environment_variable('SOURCE_FOLDER'), '..', 'logs')


def logfile_handler(filename, debug=False, **kwargs):
    config = {
        'filename': join_path(LOG_FOLDER, filename),
        'filters': ['debug_on'] if debug else ['debug_off'],
        'level': 'DEBUG' if debug else 'WARNING',
        'class': 'logging.FileHandler',
        'formatter': 'verbose',
    }
    config.update(kwargs)
    return config


LOGGING = {
    'version': 1,
    'disable_existing_loggers': True,
}
LOGGING['filters'] = {
    'debug_off': {
        '()': 'django.utils.log.RequireDebugFalse'
    },
    'debug_on': {
        '()': 'django.utils.log.RequireDebugTrue'
    }