django-rosetta/testproject/settings.py

128 lines
3.7 KiB
Python
Raw Permalink Normal View History

2012-04-15 07:02:06 +00:00
import os
import sys
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",
}
2023-12-04 15:48:07 +00:00
}
2015-10-05 13:26:59 +00:00
# CACHES = {'default': {'BACKEND': 'django.core.cache.backends.dummy.DummyCache'}}
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",
# '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
]
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",
)
# Note: languages are overridden in the test runner
2012-04-15 07:02:06 +00:00
LANGUAGES = (
("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
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
TEMPLATES = [
{
2021-06-17 07:48:35 +00:00
"BACKEND": "django.template.backends.django.DjangoTemplates",
"APP_DIRS": True,
"OPTIONS": {
"debug": False,
"context_processors": (
"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",
"django.contrib.messages.context_processors.messages",
2020-06-07 15:11:30 +00:00
"django.template.context_processors.request",
),
},
}
]
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"
2014-09-17 08:22:17 +00:00
ROSETTA_ENABLE_REFLANG = True
ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS = True
ROSETTA_SHOW_AT_ADMIN_PANEL = True
# 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
AZURE_CLIENT_SECRET = None # "FAKE"
DEEPL_AUTH_KEY = None
# 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/
DEEPL_LANGUAGES = None # ex: {"fr": "FR", "en": "EN-GB", "zh_Hans": "ZH"}