own_comments.settings

This module leverages on pydantic to provide a unique place to define the backend configuration.

Module Contents

Classes

Settings

These are the backend settings for _own-comments_

Attributes

settings

class own_comments.settings.Settings

Bases: pydantic.BaseSettings

These are the backend settings for _own-comments_

To modify the default value, place a .env file in the current dir when launching the backend.

class Config
env_file
SQLALCHEMY_DATABASE_URL :str

A URL supported by SQLAlchemy. Refer to their docs to see the different options. sqlite:////somewhere/on/your/computer/comments.db is probably a good choice

ADMIN_USERNAME :str = admin

Username of the admin. Needs to be used for with basic HTTP auth for privileged endpoints.

ADMIN_PASS :str = pass

Password of the admin. Needs to be used for with basic HTTP auth for privileged endpoints.

AUTO_APPROVE_NEW_THREADS :bool = True

Whether newly posted comments are automatically approved by default.

ALLOW_ORIGIN_REGEX :str = .*

A python regex to allow origin (CORS stuff).

URL_PREFIX =

If your own-comments instance does not lie at the root of the webserver, specify it here to ensure redirects work properly.

SMTP_SERVER :Optional[str]

SMTP server for sending email notifications to the admin

SMTP_PORT :Optional[str]

SMTP server port

SMTP_LOGIN :Optional[str]

SMTP username

SMTP_PASS :Optional[str]

SMTP password

SMTP_FROM :Optional[str]

The email or name that should be used to populate the “from” field of sent emails

SMTP_TO :Optional[str]

The email that should be used to populate the “to” field of sent emails

warn_default_value(cls, v: str, field: pydantic.fields.ModelField)
own_comments.settings.settings