diff options
author | Tyler Kennedy | 2022-12-01 11:53:45 -0500 |
---|---|---|
committer | GitHub | 2022-12-01 09:53:45 -0700 |
commit | ee9ac29cca27f3fad29ae12696ae715360db6cc7 (patch) | |
tree | a288a6a10eabf5c1394e7c6d4420314e85ca706e /takahe | |
parent | 9fd70424bb54793613e93042bf157a03dc47a697 (diff) | |
download | takahe-ee9ac29cca27f3fad29ae12696ae715360db6cc7.tar.gz takahe-ee9ac29cca27f3fad29ae12696ae715360db6cc7.tar.bz2 takahe-ee9ac29cca27f3fad29ae12696ae715360db6cc7.zip |
Test support for sqlite. (#68)
Diffstat (limited to 'takahe')
-rw-r--r-- | takahe/settings.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/takahe/settings.py b/takahe/settings.py index 288ecca..788654d 100644 --- a/takahe/settings.py +++ b/takahe/settings.py @@ -7,12 +7,16 @@ from typing import List, Literal, Optional, Union import dj_database_url import sentry_sdk -from pydantic import AnyUrl, BaseSettings, EmailStr, Field, PostgresDsn, validator +from pydantic import AnyUrl, BaseSettings, EmailStr, Field, validator from sentry_sdk.integrations.django import DjangoIntegration BASE_DIR = Path(__file__).resolve().parent.parent +class ImplicitHostname(AnyUrl): + host_required = False + + class MediaBackendUrl(AnyUrl): host_required = False allowed_schemes = {"s3", "gcs", "local"} @@ -35,11 +39,6 @@ TAKAHE_ENV_FILE = os.environ.get( ) -TAKAHE_ENV_FILE = os.environ.get( - "TAKAHE_ENV_FILE", "test.env" if "pytest" in sys.modules else ".env" -) - - class Settings(BaseSettings): """ Pydantic-powered settings, to provide consistent error messages, strong @@ -47,7 +46,7 @@ class Settings(BaseSettings): """ #: The default database. - DATABASE_SERVER: Optional[PostgresDsn] + DATABASE_SERVER: Optional[ImplicitHostname] #: The currently running environment, used for things such as sentry #: error reporting. @@ -91,6 +90,10 @@ class Settings(BaseSettings): MEDIA_ROOT: str = str(BASE_DIR / "media") MEDIA_BACKEND: Optional[MediaBackendUrl] = None + #: If search features like full text search should be enabled. + #: (placeholder setting, no effect) + SEARCH: bool = True + PGHOST: Optional[str] = None PGPORT: Optional[int] = 5432 PGNAME: str = "takahe" |