Closed earshinov closed 5 months ago
Hey @earshinov 👋🏻 Can you share your Django version?
Hey @erhosen, sure!
Tests above are run with
poetry.lock
)I observe the same errors in my project, running
Hi there 👋🏻
This may be a pragmatic approach and may not fix the root cause, but it will get rid of the warnings: Just set the type of your DatabaseConfig to str | dict
or str | dict[str, Any]
class DatabaseSettings(BaseDBConfig):
"""https://docs.djangoproject.com/en/dev/ref/settings/#databases"""
default: str | dict[str, Any] = Field(
default=str(f"sqlite:///{BASE_DIR}/db.sqlite3"),
validation_alias="DATABASE_URL",
conn_max_age=0,
ssl_require=False,
)
model_config = SettingsConfigDict(env_file=BASE_DIR / ".env")
(Tested with Python 3.10.12, Django 5.0.6, pydjantic 1.1.4)
I'm not sure if this might be confusing, but if you want I can do a quick pr to add this to the tests and demo.
I'm not sure if this might be confusing, but if you want I can do a quick pr to add this to the tests and demo.
Thanks @worldworm, it would be nice to get rid of the warning!
Even when running tests:
Seems to come from database configuration, e.g. (in
test_dsn_and_exact_config
):Applications still run, however:
-Werror
python interpreter flag