2012-04-15 07:02:06 +00:00
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
|
2023-01-01 13:17:08 +00:00
|
|
|
|
2012-04-15 07:02:06 +00:00
|
|
|
SITE_ID = 1
|
|
|
|
|
|
|
|
|
|
PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
|
|
|
|
|
|
2021-06-17 07:48:35 +00:00
|
|
|
PYTHON_VERSION = "%s.%s" % sys.version_info[:2]
|
2012-04-15 07:02:06 +00:00
|
|
|
|
|
|
|
|
DATABASES = {
|
2021-06-17 07:48:35 +00:00
|
|
|
"default": {
|
|
|
|
|
"ENGINE": "django.db.backends.sqlite3",
|
|
|
|
|
"NAME": os.path.join(PROJECT_PATH, "rosetta.db"),
|
2012-04-15 07:02:06 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-04 15:48:07 +00:00
|
|
|
CACHES = {
|
|
|
|
|
"default": {
|
|
|
|
|
"BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
|
|
|
|
|
"LOCATION": "127.0.0.1:11211",
|
|
|
|
|
"KEY_PREFIX": "ROSETTA_TEST",
|
2013-01-09 14:03:01 +00:00
|
|
|
}
|
2023-12-04 15:48:07 +00:00
|
|
|
}
|
2013-01-09 14:03:01 +00:00
|
|
|
|
2015-10-05 13:26:59 +00:00
|
|
|
# CACHES = {'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}}
|
2013-01-09 14:03:01 +00:00
|
|
|
|
2012-04-15 07:02:06 +00:00
|
|
|
TEST_DATABASE_CHARSET = "utf8"
|
|
|
|
|
TEST_DATABASE_COLLATION = "utf8_general_ci"
|
|
|
|
|
|
|
|
|
|
DATABASE_SUPPORTS_TRANSACTIONS = True
|
2021-06-17 07:48:35 +00:00
|
|
|
SETTINGS_MODULE = "testproject.settings"
|
2012-04-15 07:02:06 +00:00
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
2021-06-17 07:48:35 +00:00
|
|
|
"django.contrib.auth",
|
|
|
|
|
"django.contrib.admin",
|
2015-02-25 14:43:52 +00:00
|
|
|
# 'django.contrib.admin.apps.SimpleAdminConfig',
|
|
|
|
|
# 'django.contrib.redirects.apps.RedirectsConfig',
|
2021-06-17 07:48:35 +00:00
|
|
|
"django.contrib.contenttypes",
|
|
|
|
|
"django.contrib.sessions",
|
|
|
|
|
"django.contrib.sites",
|
|
|
|
|
"django.contrib.messages",
|
|
|
|
|
"rosetta",
|
2023-12-04 15:48:07 +00:00
|
|
|
"rosetta.tests.test_app.apps.TestAppConfig",
|
2012-04-15 07:02:06 +00:00
|
|
|
]
|
2015-02-25 14:43:52 +00:00
|
|
|
|
2012-04-15 07:02:06 +00:00
|
|
|
LANGUAGE_CODE = "en"
|
|
|
|
|
|
2018-08-24 07:11:26 +00:00
|
|
|
MIDDLEWARE = (
|
2021-06-17 07:48:35 +00:00
|
|
|
"django.middleware.common.CommonMiddleware",
|
|
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
|
|
|
"django.middleware.csrf.CsrfViewMiddleware",
|
|
|
|
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
|
|
|
"django.contrib.messages.middleware.MessageMiddleware",
|
2014-09-17 08:40:41 +00:00
|
|
|
)
|
|
|
|
|
|
2016-03-08 08:50:22 +00:00
|
|
|
# Note: languages are overridden in the test runner
|
2012-04-15 07:02:06 +00:00
|
|
|
LANGUAGES = (
|
2023-01-01 13:17:08 +00:00
|
|
|
("en", "English"),
|
|
|
|
|
("bs-Cyrl-BA", "Bosnian (Cyrillic) (Bosnia and Herzegovina)"),
|
|
|
|
|
("ja", "日本語"),
|
|
|
|
|
("xx", "XXXXX"),
|
|
|
|
|
("fr", "French"),
|
|
|
|
|
("zh_Hans", "Chinese (Simplified)"),
|
|
|
|
|
("fr_FR.utf8", "French (France), UTF8"),
|
2012-04-15 07:02:06 +00:00
|
|
|
)
|
2015-09-14 08:19:45 +00:00
|
|
|
|
2021-06-03 12:24:40 +00:00
|
|
|
|
2020-04-13 15:12:07 +00:00
|
|
|
SILENCED_SYSTEM_CHECKS = ["translation.E002"]
|
|
|
|
|
|
|
|
|
|
|
2021-06-17 07:48:35 +00:00
|
|
|
LOCALE_PATHS = [os.path.join(PROJECT_PATH, "locale")]
|
2012-04-15 07:02:06 +00:00
|
|
|
|
2021-06-17 07:48:35 +00:00
|
|
|
FIXTURE_DIRS = (os.path.join(PROJECT_PATH, "fixtures"),)
|
|
|
|
|
STATIC_URL = "/static/"
|
|
|
|
|
ROOT_URLCONF = "testproject.urls"
|
2012-04-15 07:02:06 +00:00
|
|
|
|
|
|
|
|
DEBUG = True
|
2015-09-24 09:20:09 +00:00
|
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
|
{
|
2021-06-17 07:48:35 +00:00
|
|
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
|
|
|
"APP_DIRS": True,
|
|
|
|
|
"OPTIONS": {
|
|
|
|
|
"debug": False,
|
|
|
|
|
"context_processors": (
|
2015-09-24 09:20:09 +00:00
|
|
|
"django.contrib.auth.context_processors.auth",
|
|
|
|
|
"django.template.context_processors.debug",
|
|
|
|
|
"django.template.context_processors.i18n",
|
|
|
|
|
"django.template.context_processors.media",
|
|
|
|
|
"django.template.context_processors.static",
|
|
|
|
|
"django.template.context_processors.tz",
|
2020-06-07 14:43:21 +00:00
|
|
|
"django.contrib.messages.context_processors.messages",
|
2020-06-07 15:11:30 +00:00
|
|
|
"django.template.context_processors.request",
|
2020-06-07 14:43:21 +00:00
|
|
|
),
|
|
|
|
|
},
|
|
|
|
|
}
|
2015-09-24 09:20:09 +00:00
|
|
|
]
|
2012-06-07 11:47:53 +00:00
|
|
|
|
2023-12-04 15:48:07 +00:00
|
|
|
USE_TZ = True
|
|
|
|
|
|
2021-06-17 07:48:35 +00:00
|
|
|
STATIC_URL = "/static/"
|
2016-03-22 08:09:55 +00:00
|
|
|
|
|
|
|
|
# SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"
|
|
|
|
|
# ROSETTA_STORAGE_CLASS = 'rosetta.storage.SessionRosettaStorage'
|
|
|
|
|
|
2021-06-17 07:48:35 +00:00
|
|
|
ROSETTA_STORAGE_CLASS = "rosetta.storage.CacheRosettaStorage"
|
|
|
|
|
SECRET_KEY = "empty"
|
2015-02-18 12:32:03 +00:00
|
|
|
|
2014-09-17 08:22:17 +00:00
|
|
|
ROSETTA_ENABLE_REFLANG = True
|
2015-02-18 12:32:03 +00:00
|
|
|
ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS = True
|
2016-12-13 10:26:01 +00:00
|
|
|
ROSETTA_SHOW_AT_ADMIN_PANEL = True
|
2019-04-23 14:43:39 +00:00
|
|
|
# ROSETTA_SHOW_OCCURRENCES = True
|
2018-08-07 06:28:13 +00:00
|
|
|
|
|
|
|
|
# fake azure key that matches the one in
|
|
|
|
|
# fixtures/vcr_cassettes/test_47_azure_ajax_translation.yaml
|
2021-06-03 12:24:40 +00:00
|
|
|
AZURE_CLIENT_SECRET = None # "FAKE"
|
|
|
|
|
|
2021-06-03 13:35:49 +00:00
|
|
|
DEEPL_AUTH_KEY = None
|
2021-06-03 12:24:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# Deepl API language codes are different then those of django, so if this is not set according to your desired languages,
|
|
|
|
|
# We use the uppercase version of the first 2 letters of django language code.
|
|
|
|
|
# In which case it would work fine for most of the languages,
|
|
|
|
|
# But for 'en' if you want "EN-GB" for example, please set it in this dictionary.
|
|
|
|
|
# Please check the supported languages list of DeepL API: https://www.deepl.com/docs-api/translating-text/request/
|
2021-06-03 13:35:49 +00:00
|
|
|
DEEPL_LANGUAGES = None # ex: {"fr": "FR", "en": "EN-GB", "zh_Hans": "ZH"}
|