2020-05-01 22:46:15 +08:00
|
|
|
"""
|
|
|
|
Django settings for boofilsic project.
|
|
|
|
|
|
|
|
Generated by 'django-admin startproject' using Django 3.0.5.
|
|
|
|
|
|
|
|
For more information on this file, see
|
|
|
|
https://docs.djangoproject.com/en/3.0/topics/settings/
|
|
|
|
|
|
|
|
For the full list of settings and their values, see
|
|
|
|
https://docs.djangoproject.com/en/3.0/ref/settings/
|
|
|
|
"""
|
|
|
|
|
|
|
|
import os
|
2022-12-09 19:38:11 -05:00
|
|
|
|
2023-05-20 11:01:18 -04:00
|
|
|
PROJECT_ROOT = os.path.abspath(os.path.dirname(__name__))
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
|
|
|
2022-11-09 13:56:50 -05:00
|
|
|
# https://docs.djangoproject.com/en/3.2/releases/3.2/#customizing-type-of-auto-created-primary-keys
|
2023-01-02 00:03:13 -05:00
|
|
|
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
|
|
|
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/
|
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
2023-01-02 00:03:13 -05:00
|
|
|
SECRET_KEY = "nbv58c^&b8-095(^)&_BV98596v)&CX#^$&%*^V5"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
|
|
|
DEBUG = True
|
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
ALLOWED_HOSTS = ["*"]
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2021-02-25 19:49:50 +01:00
|
|
|
# To allow debug in template context
|
|
|
|
# https://docs.djangoproject.com/en/3.1/ref/settings/#internal-ips
|
2023-01-02 00:03:13 -05:00
|
|
|
INTERNAL_IPS = ["127.0.0.1"]
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
# Application definition
|
|
|
|
|
|
|
|
INSTALLED_APPS = [
|
2023-01-11 00:55:56 -05:00
|
|
|
"maintenance_mode", # this has to be first
|
2023-01-02 00:03:13 -05:00
|
|
|
"django.contrib.admin",
|
|
|
|
"hijack",
|
|
|
|
"hijack.contrib.admin",
|
|
|
|
"django.contrib.auth",
|
|
|
|
"django.contrib.contenttypes",
|
|
|
|
"django.contrib.sessions",
|
|
|
|
"django.contrib.messages",
|
|
|
|
"django.contrib.staticfiles",
|
|
|
|
"django.contrib.humanize",
|
|
|
|
"django.contrib.postgres",
|
|
|
|
"django_sass",
|
|
|
|
"django_rq",
|
2023-01-26 17:31:20 -05:00
|
|
|
"django_bleach",
|
2023-01-10 22:36:13 -05:00
|
|
|
"tz_detect",
|
2023-05-20 11:01:18 -04:00
|
|
|
"sass_processor",
|
2023-01-02 00:03:13 -05:00
|
|
|
"simple_history",
|
|
|
|
"markdownx",
|
2023-01-11 00:55:56 -05:00
|
|
|
"polymorphic",
|
|
|
|
"easy_thumbnails",
|
|
|
|
"user_messages",
|
|
|
|
"jsoneditor",
|
2023-02-11 20:40:00 -05:00
|
|
|
"fontawesomefree",
|
2023-01-11 00:55:56 -05:00
|
|
|
]
|
|
|
|
|
|
|
|
INSTALLED_APPS += [
|
2023-01-02 00:03:13 -05:00
|
|
|
"management.apps.ManagementConfig",
|
|
|
|
"mastodon.apps.MastodonConfig",
|
|
|
|
"common.apps.CommonConfig",
|
|
|
|
"users.apps.UsersConfig",
|
|
|
|
"catalog.apps.CatalogConfig",
|
|
|
|
"journal.apps.JournalConfig",
|
|
|
|
"social.apps.SocialConfig",
|
|
|
|
"legacy.apps.LegacyConfig",
|
2023-01-11 00:55:56 -05:00
|
|
|
]
|
|
|
|
|
2020-05-01 22:46:15 +08:00
|
|
|
MIDDLEWARE = [
|
2023-01-02 00:03:13 -05:00
|
|
|
"django.middleware.security.SecurityMiddleware",
|
|
|
|
"django.contrib.sessions.middleware.SessionMiddleware",
|
|
|
|
"django.middleware.common.CommonMiddleware",
|
|
|
|
"django.middleware.csrf.CsrfViewMiddleware",
|
|
|
|
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
|
|
|
"django.contrib.messages.middleware.MessageMiddleware",
|
|
|
|
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
|
|
|
"hijack.middleware.HijackUserMiddleware",
|
2023-01-10 22:36:13 -05:00
|
|
|
"tz_detect.middleware.TimezoneMiddleware",
|
2023-01-02 00:03:13 -05:00
|
|
|
"simple_history.middleware.HistoryRequestMiddleware",
|
2023-01-11 00:55:56 -05:00
|
|
|
"maintenance_mode.middleware.MaintenanceModeMiddleware", # this should be last
|
2020-05-01 22:46:15 +08:00
|
|
|
]
|
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
ROOT_URLCONF = "boofilsic.urls"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
2023-01-02 00:03:13 -05:00
|
|
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
|
|
"DIRS": [],
|
|
|
|
"APP_DIRS": True,
|
|
|
|
"OPTIONS": {
|
|
|
|
"context_processors": [
|
|
|
|
"django.template.context_processors.debug",
|
|
|
|
"django.template.context_processors.request",
|
|
|
|
"django.contrib.auth.context_processors.auth",
|
2022-11-09 13:56:50 -05:00
|
|
|
# 'django.contrib.messages.context_processors.messages',
|
|
|
|
"user_messages.context_processors.messages",
|
2023-01-02 00:03:13 -05:00
|
|
|
"boofilsic.context_processors.site_info",
|
2020-05-01 22:46:15 +08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
WSGI_APPLICATION = "boofilsic.wsgi.application"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2023-01-29 21:09:29 -05:00
|
|
|
CACHES = {
|
|
|
|
"default": {
|
|
|
|
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
|
|
|
|
}
|
|
|
|
}
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
# Database
|
|
|
|
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases
|
|
|
|
|
|
|
|
if DEBUG:
|
|
|
|
DATABASES = {
|
2023-01-02 00:03:13 -05:00
|
|
|
"default": {
|
|
|
|
"ENGINE": "django.db.backends.postgresql",
|
|
|
|
"NAME": os.environ.get("DB_NAME", "test"),
|
|
|
|
"USER": os.environ.get("DB_USER", "postgres"),
|
|
|
|
"PASSWORD": os.environ.get("DB_PASSWORD", "admin123"),
|
|
|
|
"HOST": os.environ.get("DB_HOST", "127.0.0.1"),
|
|
|
|
"OPTIONS": {
|
|
|
|
"client_encoding": "UTF8",
|
2020-05-01 22:46:15 +08:00
|
|
|
# 'isolation_level': psycopg2.extensions.ISOLATION_LEVEL_DEFAULT,
|
2023-01-02 00:03:13 -05:00
|
|
|
},
|
2022-12-13 18:12:43 +00:00
|
|
|
}
|
2020-05-01 22:46:15 +08:00
|
|
|
}
|
|
|
|
else:
|
|
|
|
DATABASES = {
|
2023-01-02 00:03:13 -05:00
|
|
|
"default": {
|
|
|
|
"ENGINE": "django.db.backends.postgresql",
|
|
|
|
"NAME": "boofilsic",
|
|
|
|
"USER": "doubaniux",
|
|
|
|
"PASSWORD": "password",
|
|
|
|
"HOST": "localhost",
|
|
|
|
"OPTIONS": {
|
|
|
|
"client_encoding": "UTF8",
|
2020-05-01 22:46:15 +08:00
|
|
|
# 'isolation_level': psycopg2.extensions.ISOLATION_LEVEL_DEFAULT,
|
2023-01-02 00:03:13 -05:00
|
|
|
},
|
2022-12-13 18:12:43 +00:00
|
|
|
}
|
2020-05-01 22:46:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
# Customized auth backend, glue OAuth2 and Django User model together
|
|
|
|
# https://docs.djangoproject.com/en/3.0/topics/auth/customizing/#authentication-backends
|
|
|
|
|
|
|
|
AUTHENTICATION_BACKENDS = [
|
2023-01-02 00:03:13 -05:00
|
|
|
"mastodon.auth.OAuth2Backend",
|
2020-05-11 19:16:56 +08:00
|
|
|
]
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
|
2023-01-30 22:11:47 -05:00
|
|
|
MARKDOWNX_MARKDOWNIFY_FUNCTION = "journal.renderers.render_md"
|
|
|
|
|
|
|
|
|
2020-05-01 22:46:15 +08:00
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/3.0/topics/i18n/
|
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
LANGUAGE_CODE = "zh-hans"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
TIME_ZONE = "Asia/Shanghai"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
|
2020-05-06 19:44:44 +08:00
|
|
|
if not DEBUG:
|
|
|
|
SESSION_COOKIE_SECURE = True
|
|
|
|
CSRF_COOKIE_SECURE = True
|
|
|
|
SECURE_SSL_REDIRECT = True
|
2020-05-11 19:19:48 +08:00
|
|
|
SECURE_HSTS_PRELOAD = True
|
|
|
|
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
|
|
|
|
SECURE_HSTS_SECONDS = 31536000
|
2021-02-25 19:49:50 +01:00
|
|
|
|
2020-05-06 19:44:44 +08:00
|
|
|
LOGGING = {
|
2023-01-02 00:03:13 -05:00
|
|
|
"version": 1,
|
|
|
|
"disable_existing_loggers": False,
|
|
|
|
"formatters": {
|
|
|
|
"simple": {
|
|
|
|
"format": "{levelname} {asctime} {name}:{lineno} {message}",
|
|
|
|
"style": "{",
|
2021-02-25 19:49:50 +01:00
|
|
|
},
|
2022-12-13 18:12:43 +00:00
|
|
|
},
|
2023-01-02 00:03:13 -05:00
|
|
|
"handlers": {
|
|
|
|
"file": {
|
|
|
|
"level": "INFO",
|
|
|
|
"class": "logging.FileHandler",
|
|
|
|
"filename": os.path.join(BASE_DIR, "log"),
|
|
|
|
"formatter": "simple",
|
2021-02-25 19:43:43 +01:00
|
|
|
},
|
2020-05-07 06:05:09 +08:00
|
|
|
},
|
2023-01-02 00:03:13 -05:00
|
|
|
"root": {
|
|
|
|
"handlers": ["file"],
|
|
|
|
"level": "INFO",
|
|
|
|
"propagate": True,
|
2020-05-06 19:44:44 +08:00
|
|
|
},
|
2021-02-25 19:49:50 +01:00
|
|
|
}
|
2020-05-06 19:44:44 +08:00
|
|
|
|
2020-05-01 22:46:15 +08:00
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/3.0/howto/static-files/
|
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
STATIC_URL = "/static/"
|
|
|
|
STATIC_ROOT = os.path.join(BASE_DIR, "static/")
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.ManifestStaticFilesStorage"
|
2023-05-20 11:01:18 -04:00
|
|
|
STATICFILES_FINDERS = [
|
|
|
|
"django.contrib.staticfiles.finders.FileSystemFinder",
|
|
|
|
"django.contrib.staticfiles.finders.AppDirectoriesFinder",
|
|
|
|
"sass_processor.finders.CssFinder",
|
|
|
|
]
|
2021-02-25 19:49:50 +01:00
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
AUTH_USER_MODEL = "users.User"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2022-11-09 13:56:50 -05:00
|
|
|
SILENCED_SYSTEM_CHECKS = [
|
|
|
|
"auth.W004", # User.username is non-unique
|
2023-01-02 00:03:13 -05:00
|
|
|
"admin.E404", # Required by django-user-messages
|
2022-11-09 13:56:50 -05:00
|
|
|
]
|
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
MEDIA_URL = "/media/"
|
|
|
|
MEDIA_ROOT = os.path.join(BASE_DIR, "media/")
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2022-11-09 13:56:50 -05:00
|
|
|
SITE_INFO = {
|
2023-01-02 00:03:13 -05:00
|
|
|
"site_name": "NiceDB",
|
2023-05-20 11:01:18 -04:00
|
|
|
"site_url": "https://nicedb.org",
|
2023-01-02 00:03:13 -05:00
|
|
|
"support_link": "https://github.com/doubaniux/boofilsic/issues",
|
2023-01-21 15:11:30 -05:00
|
|
|
"social_link": "https://donotban.com/@testie",
|
|
|
|
"donation_link": "https://patreon.com/tertius",
|
2023-01-02 00:03:13 -05:00
|
|
|
"version_hash": None,
|
|
|
|
"settings_module": os.getenv("DJANGO_SETTINGS_MODULE"),
|
|
|
|
"sentry_dsn": None,
|
2022-11-09 13:56:50 -05:00
|
|
|
}
|
|
|
|
|
2021-02-25 19:49:50 +01:00
|
|
|
# Mastodon configs
|
2023-01-02 00:03:13 -05:00
|
|
|
CLIENT_NAME = os.environ.get("APP_NAME", "NiceDB")
|
|
|
|
SITE_INFO["site_name"] = os.environ.get("APP_NAME", "NiceDB")
|
|
|
|
APP_WEBSITE = os.environ.get("APP_URL", "https://nicedb.org")
|
2022-11-09 13:56:50 -05:00
|
|
|
REDIRECT_URIS = APP_WEBSITE + "/users/OAuth2_login/"
|
2023-05-20 11:01:18 -04:00
|
|
|
SITE_INFO["site_url"] = APP_WEBSITE
|
2022-11-09 13:56:50 -05:00
|
|
|
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2021-02-25 19:49:50 +01:00
|
|
|
# Path to save report related images, ends with slash
|
2023-01-02 00:03:13 -05:00
|
|
|
REPORT_MEDIA_PATH_ROOT = "report/"
|
|
|
|
MARKDOWNX_MEDIA_PATH = "review/"
|
|
|
|
BOOK_MEDIA_PATH_ROOT = "book/"
|
|
|
|
DEFAULT_BOOK_IMAGE = os.path.join(BOOK_MEDIA_PATH_ROOT, "default.svg")
|
|
|
|
MOVIE_MEDIA_PATH_ROOT = "movie/"
|
|
|
|
DEFAULT_MOVIE_IMAGE = os.path.join(MOVIE_MEDIA_PATH_ROOT, "default.svg")
|
|
|
|
SONG_MEDIA_PATH_ROOT = "song/"
|
|
|
|
DEFAULT_SONG_IMAGE = os.path.join(SONG_MEDIA_PATH_ROOT, "default.svg")
|
|
|
|
ALBUM_MEDIA_PATH_ROOT = "album/"
|
|
|
|
DEFAULT_ALBUM_IMAGE = os.path.join(ALBUM_MEDIA_PATH_ROOT, "default.svg")
|
|
|
|
GAME_MEDIA_PATH_ROOT = "game/"
|
|
|
|
DEFAULT_GAME_IMAGE = os.path.join(GAME_MEDIA_PATH_ROOT, "default.svg")
|
|
|
|
COLLECTION_MEDIA_PATH_ROOT = "collection/"
|
|
|
|
DEFAULT_COLLECTION_IMAGE = os.path.join(COLLECTION_MEDIA_PATH_ROOT, "default.svg")
|
|
|
|
SYNC_FILE_PATH_ROOT = "sync/"
|
|
|
|
EXPORT_FILE_PATH_ROOT = "export/"
|
2022-11-09 13:56:50 -05:00
|
|
|
|
|
|
|
# Allow user to login via any Mastodon/Pleroma sites
|
|
|
|
MASTODON_ALLOW_ANY_SITE = False
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2020-05-05 23:50:48 +08:00
|
|
|
# Timeout of requests to Mastodon, in seconds
|
|
|
|
MASTODON_TIMEOUT = 30
|
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
MASTODON_CLIENT_SCOPE = "read write follow"
|
2022-12-13 18:12:43 +00:00
|
|
|
# use the following if it's a new site
|
2023-01-02 00:03:13 -05:00
|
|
|
# MASTODON_CLIENT_SCOPE = 'read:accounts read:follows read:search read:blocks read:mutes write:statuses write:media'
|
2022-11-09 13:56:50 -05:00
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
MASTODON_LEGACY_CLIENT_SCOPE = "read write follow"
|
2022-11-09 13:56:50 -05:00
|
|
|
|
2020-07-29 23:34:06 +08:00
|
|
|
# Tags for toots posted from this site
|
2023-01-02 00:03:13 -05:00
|
|
|
MASTODON_TAGS = "#NiceDB #NiceDB%(category)s #NiceDB%(category)s%(type)s"
|
2020-07-29 23:34:06 +08:00
|
|
|
|
2020-05-06 16:42:18 +08:00
|
|
|
# Emoji code in mastodon
|
2023-01-02 00:03:13 -05:00
|
|
|
STAR_SOLID = ":star_solid:"
|
|
|
|
STAR_HALF = ":star_half:"
|
|
|
|
STAR_EMPTY = ":star_empty:"
|
2020-05-06 16:42:18 +08:00
|
|
|
|
2022-11-09 13:56:50 -05:00
|
|
|
# Default password for each user. since password is not used any way,
|
2020-05-01 22:46:15 +08:00
|
|
|
# any string that is not empty is ok
|
2023-01-02 00:03:13 -05:00
|
|
|
DEFAULT_PASSWORD = "ab7nsm8didusbaqPgq"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
# Default redirect loaction when access login required view
|
2023-01-02 00:03:13 -05:00
|
|
|
LOGIN_URL = "/users/login/"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
|
|
|
# Admin site root url
|
2023-01-02 00:03:13 -05:00
|
|
|
ADMIN_URL = "tertqX7256n7ej8nbv5cwvsegdse6w7ne5rHd"
|
2020-05-01 22:46:15 +08:00
|
|
|
|
2020-07-03 15:36:23 +08:00
|
|
|
# Luminati proxy settings
|
2023-01-02 00:03:13 -05:00
|
|
|
LUMINATI_USERNAME = "lum-customer-hl_nw4tbv78-zone-static"
|
|
|
|
LUMINATI_PASSWORD = "nsb7te9bw0ney"
|
2021-02-25 19:43:43 +01:00
|
|
|
|
2022-11-09 13:56:50 -05:00
|
|
|
SCRAPING_TIMEOUT = 90
|
|
|
|
|
2021-09-01 12:56:01 +02:00
|
|
|
# ScraperAPI api key
|
2023-01-02 00:03:13 -05:00
|
|
|
SCRAPERAPI_KEY = "***REMOVED***"
|
2022-11-09 13:56:50 -05:00
|
|
|
PROXYCRAWL_KEY = None
|
|
|
|
SCRAPESTACK_KEY = None
|
2021-09-01 12:56:01 +02:00
|
|
|
|
2021-02-25 19:43:43 +01:00
|
|
|
# Spotify credentials
|
2022-11-11 18:40:02 +01:00
|
|
|
SPOTIFY_CREDENTIAL = "***REMOVED***"
|
2021-02-25 19:49:50 +01:00
|
|
|
|
|
|
|
# IMDb API service https://imdb-api.com/
|
2022-11-11 18:40:02 +01:00
|
|
|
IMDB_API_KEY = "***REMOVED***"
|
2021-02-25 19:49:50 +01:00
|
|
|
|
2022-11-09 13:56:50 -05:00
|
|
|
# The Movie Database (TMDB) API Keys
|
2022-11-11 18:40:02 +01:00
|
|
|
TMDB_API3_KEY = "***REMOVED***"
|
|
|
|
# TMDB_API4_KEY = "deadbeef.deadbeef.deadbeef"
|
2022-11-09 13:56:50 -05:00
|
|
|
|
|
|
|
# Google Books API Key
|
2023-01-02 00:03:13 -05:00
|
|
|
GOOGLE_API_KEY = "***REMOVED***"
|
2022-11-09 13:56:50 -05:00
|
|
|
|
2023-02-03 18:29:51 +01:00
|
|
|
# Discogs API Key
|
|
|
|
# How to get: a personal access token from https://www.discogs.com/settings/developers
|
|
|
|
DISCOGS_API_KEY = "***REMOVED***"
|
|
|
|
|
2022-11-09 13:56:50 -05:00
|
|
|
# IGDB
|
2023-01-02 00:03:13 -05:00
|
|
|
IGDB_CLIENT_ID = "deadbeef"
|
|
|
|
IGDB_CLIENT_SECRET = "deadbeef"
|
2022-11-09 13:56:50 -05:00
|
|
|
|
2023-01-26 17:31:20 -05:00
|
|
|
BLEACH_STRIP_COMMENTS = True
|
|
|
|
BLEACH_STRIP_TAGS = True
|
|
|
|
|
2021-02-25 19:49:50 +01:00
|
|
|
# Thumbnail setting
|
|
|
|
# It is possible to optimize the image size even more: https://easy-thumbnails.readthedocs.io/en/latest/ref/optimize/
|
|
|
|
THUMBNAIL_ALIASES = {
|
2023-01-02 00:03:13 -05:00
|
|
|
"": {
|
|
|
|
"normal": {
|
|
|
|
"size": (200, 200),
|
|
|
|
"crop": "scale",
|
|
|
|
"autocrop": True,
|
2021-02-25 19:49:50 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
# THUMBNAIL_PRESERVE_EXTENSIONS = ('svg',)
|
|
|
|
if DEBUG:
|
|
|
|
THUMBNAIL_DEBUG = True
|
2020-07-03 15:36:23 +08:00
|
|
|
|
2020-05-01 22:46:15 +08:00
|
|
|
# https://django-debug-toolbar.readthedocs.io/en/latest/
|
2020-05-06 19:44:44 +08:00
|
|
|
# maybe benchmarking before deployment
|
2022-11-09 13:56:50 -05:00
|
|
|
|
2023-01-02 00:03:13 -05:00
|
|
|
REDIS_HOST = os.environ.get("REDIS_HOST", "127.0.0.1")
|
2022-11-09 13:56:50 -05:00
|
|
|
|
|
|
|
RQ_QUEUES = {
|
2023-01-02 00:03:13 -05:00
|
|
|
"mastodon": {
|
|
|
|
"HOST": REDIS_HOST,
|
|
|
|
"PORT": 6379,
|
|
|
|
"DB": 0,
|
|
|
|
"DEFAULT_TIMEOUT": -1,
|
2022-11-09 13:56:50 -05:00
|
|
|
},
|
2023-01-02 00:03:13 -05:00
|
|
|
"export": {
|
|
|
|
"HOST": REDIS_HOST,
|
|
|
|
"PORT": 6379,
|
|
|
|
"DB": 0,
|
|
|
|
"DEFAULT_TIMEOUT": -1,
|
|
|
|
},
|
2023-01-11 00:55:56 -05:00
|
|
|
"import": {
|
|
|
|
"HOST": "localhost",
|
|
|
|
"PORT": 6379,
|
|
|
|
"DB": 0,
|
|
|
|
"DEFAULT_TIMEOUT": -1,
|
|
|
|
},
|
|
|
|
"fetch": {
|
|
|
|
"HOST": "localhost",
|
|
|
|
"PORT": 6379,
|
|
|
|
"DB": 0,
|
|
|
|
"DEFAULT_TIMEOUT": -1,
|
|
|
|
},
|
|
|
|
"crawl": {
|
|
|
|
"HOST": "localhost",
|
|
|
|
"PORT": 6379,
|
|
|
|
"DB": 0,
|
|
|
|
"DEFAULT_TIMEOUT": -1,
|
|
|
|
},
|
2023-01-02 00:03:13 -05:00
|
|
|
"doufen": {
|
|
|
|
"HOST": REDIS_HOST,
|
|
|
|
"PORT": 6379,
|
|
|
|
"DB": 0,
|
|
|
|
"DEFAULT_TIMEOUT": -1,
|
2022-11-09 13:56:50 -05:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
RQ_SHOW_ADMIN_LINK = True
|
|
|
|
|
|
|
|
SEARCH_INDEX_NEW_ONLY = False
|
|
|
|
|
|
|
|
|
|
|
|
# SEARCH_BACKEND = 'MEILISEARCH'
|
|
|
|
# MEILISEARCH_SERVER = 'http://127.0.0.1:7700'
|
|
|
|
# MEILISEARCH_KEY = 'deadbeef'
|
|
|
|
|
2023-01-10 23:03:45 -05:00
|
|
|
# SEARCH_BACKEND = "TYPESENSE"
|
|
|
|
# TYPESENSE_CONNECTION = {
|
|
|
|
# "api_key": "xyz",
|
|
|
|
# "nodes": [{"host": "localhost", "port": "8108", "protocol": "http"}],
|
|
|
|
# "connection_timeout_seconds": 2,
|
|
|
|
# }
|
|
|
|
|
|
|
|
SEARCH_BACKEND = None
|
2022-12-09 19:38:11 -05:00
|
|
|
|
|
|
|
DOWNLOADER_RETRIES = 3
|
|
|
|
DOWNLOADER_SAVEDIR = None
|
2023-01-02 00:03:13 -05:00
|
|
|
DISABLE_MODEL_SIGNAL = False # disable index and social feeds during importing/etc
|
2023-01-11 00:55:56 -05:00
|
|
|
|
|
|
|
MAINTENANCE_MODE = False
|
|
|
|
MAINTENANCE_MODE_IGNORE_ADMIN_SITE = True
|
|
|
|
MAINTENANCE_MODE_IGNORE_SUPERUSER = True
|
|
|
|
MAINTENANCE_MODE_IGNORE_ANONYMOUS_USER = True
|
|
|
|
MAINTENANCE_MODE_IGNORE_URLS = (r"^/users/connect/", r"^/users/OAuth2_login/")
|
2023-05-20 11:01:18 -04:00
|
|
|
|
|
|
|
DISCORD_WEBHOOKS = {}
|