コード例 #1
0
ファイル: test_environment.py プロジェクト: renatofb/weblate
 def test_modify_list(self):
     os.environ["WEBLATE_ADD_TEST"] = "foo,bar"
     os.environ["WEBLATE_REMOVE_TEST"] = "baz,bag"
     setting = ["baz", "bag", "aaa"]
     modify_env_list(setting, "TEST")
     self.assertEqual(setting, ["foo", "bar", "aaa"])
     del os.environ["WEBLATE_ADD_TEST"]
     del os.environ["WEBLATE_REMOVE_TEST"]
コード例 #2
0
ファイル: test_environment.py プロジェクト: tdelmas/weblate
 def test_modify_list(self):
     os.environ['WEBLATE_ADD_TEST'] = 'foo,bar'
     os.environ['WEBLATE_REMOVE_TEST'] = 'baz,bag'
     setting = ['baz', 'bag', 'aaa']
     modify_env_list(setting, 'TEST')
     self.assertEqual(setting, ['foo', 'bar', 'aaa'])
     del os.environ['WEBLATE_ADD_TEST']
     del os.environ['WEBLATE_REMOVE_TEST']
コード例 #3
0
    "django.contrib.messages",
    "django.contrib.staticfiles",
    "django.contrib.admin.apps.SimpleAdminConfig",
    "django.contrib.admindocs",
    "django.contrib.sitemaps",
    "django.contrib.humanize",
    # Third party Django modules
    "social_django",
    "crispy_forms",
    "compressor",
    "rest_framework",
    "rest_framework.authtoken",
    "django_filters",
]

modify_env_list(INSTALLED_APPS, "APPS")

# Custom exception reporter to include some details
DEFAULT_EXCEPTION_REPORTER_FILTER = "weblate.trans.debug.WeblateExceptionReporterFilter"

# Default logging of Weblate messages
# - to syslog in production (if available)
# - otherwise to console
# - you can also choose "logfile" to log into separate file
#   after configuring it below

# Detect if we can connect to syslog
HAVE_SYSLOG = False

if DEBUG or not HAVE_SYSLOG:
    DEFAULT_LOG = "console"
コード例 #4
0
ファイル: settings_docker.py プロジェクト: mayeulk/weblate
    "weblate.trans",
    "weblate.lang",
    "weblate.langdata",
    "weblate.memory",
    "weblate.screenshots",
    "weblate.fonts",
    "weblate.accounts",
    "weblate.utils",
    "weblate.vcs",
    "weblate.wladmin",
    "weblate",
    # Optional: Git exporter
    "weblate.gitexport",
]

modify_env_list(INSTALLED_APPS, "APPS")

# Path to locales
LOCALE_PATHS = (os.path.join(BASE_DIR, "weblate", "locale"), )

# Custom exception reporter to include some details
DEFAULT_EXCEPTION_REPORTER_FILTER = "weblate.trans.debug.WeblateExceptionReporterFilter"

# Default logging of Weblate messages
# - to syslog in production (if available)
# - otherwise to console
# - you can also choose 'logfile' to log into separate file
#   after configuring it below

# Detect if we can connect to syslog
HAVE_SYSLOG = False
コード例 #5
0
ファイル: settings.py プロジェクト: sylvainar/docker
    'weblate.gitexport',
]

# Sentry integration
if 'SENTRY_DSN' in os.environ:
    RAVEN_CONFIG = {
        'dsn': os.environ['SENTRY_DSN'],
        'public_dsn': os.environ.get('SENTRY_PUBLIC_DSN', ''),
        'environment': os.environ.get('SENTRY_ENVIRONMENT', 'production'),
        'release': 'weblate-{}'.format(os.environ['VERSION']),
        'string_max_length': 1000,
        'list_max_length': 100,
    }
    INSTALLED_APPS.append('raven.contrib.django.raven_compat')

modify_env_list(INSTALLED_APPS, 'APPS')

# Path to locales
LOCALE_PATHS = (os.path.join(BASE_DIR, 'weblate', 'locale'), )

# Custom exception reporter to include some details
DEFAULT_EXCEPTION_REPORTER_FILTER = \
    'weblate.trans.debug.WeblateExceptionReporterFilter'

# Default logging of Weblate messages
# - to syslog in production (if available)
# - otherwise to console
# - you can also choose 'logfile' to log into separate file
#   after configuring it below

# Detect if we can connect to syslog