Skip to content

Commit 445a962

Browse files
committed
Fix Lintings
1 parent 901f88f commit 445a962

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

app/config.py.example

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import os
2+
3+
from fastapi_mail import ConnectionConfig
4+
from pydantic import BaseSettings
5+
from starlette.templating import Jinja2Templates
6+
7+
8+
class Settings(BaseSettings):
9+
app_name: str = "PyLander"
10+
bot_api: str = "BOT_API"
11+
webhook_url: str = "WEBHOOK_URL"
12+
13+
class Config:
14+
env_file = ".env"
15+
16+
17+
# GENERAL
18+
DOMAIN = 'Our-Domain'
19+
20+
# DATABASE
21+
DEVELOPMENT_DATABASE_STRING = "sqlite:///./dev.db"
22+
# Set the following True if working on PSQL environment or set False otherwise
23+
PSQL_ENVIRONMENT = False
24+
25+
# MEDIA
26+
MEDIA_DIRECTORY = 'media'
27+
PICTURE_EXTENSION = '.png'
28+
AVATAR_SIZE = (120, 120)
29+
30+
# API-KEYS
31+
WEATHER_API_KEY = os.getenv('WEATHER_API_KEY')
32+
33+
# EXPORT
34+
ICAL_VERSION = '2.0'
35+
PRODUCT_ID = '-//Our product id//'
36+
37+
# EMAIL
38+
email_conf = ConnectionConfig(
39+
MAIL_USERNAME=os.getenv("MAIL_USERNAME") or "user",
40+
MAIL_PASSWORD=os.getenv("MAIL_PASSWORD") or "password",
41+
MAIL_FROM=os.getenv("MAIL_FROM") or "[email protected]",
42+
MAIL_PORT=587,
43+
MAIL_SERVER="smtp.gmail.com",
44+
MAIL_TLS=True,
45+
MAIL_SSL=False,
46+
USE_CREDENTIALS=True,
47+
)
48+
49+
templates = Jinja2Templates(directory=os.path.join("app", "templates"))
50+
51+
# application name
52+
CALENDAR_SITE_NAME = "Calendar"
53+
# link to the home page of the application
54+
CALENDAR_HOME_PAGE = "calendar.pythonic.guru"
55+
# link to the application registration page
56+
CALENDAR_REGISTRATION_PAGE = r"calendar.pythonic.guru/registration"
57+
58+
# import
59+
MAX_FILE_SIZE_MB = 5 # 5MB
60+
VALID_FILE_EXTENSION = (".txt", ".csv", ".ics") # Can import only these files.
61+
# Events must be within 20 years range from the current year.
62+
EVENT_VALID_YEARS = 20
63+
EVENT_HEADER_NOT_EMPTY = 1 # 1- for not empty, 0- for empty.
64+
EVENT_HEADER_LIMIT = 50 # Max characters for event header.
65+
EVENT_CONTENT_LIMIT = 500 # Max characters for event characters.
66+
MAX_EVENTS_START_DATE = 10 # Max Events with the same start date.
67+
68+
# PATHS
69+
STATIC_ABS_PATH = os.path.abspath("static")
70+
71+
# LOGGER
72+
LOG_PATH = "./var/log"
73+
LOG_FILENAME = "calendar.log"
74+
LOG_LEVEL = "error"
75+
LOG_ROTATION_INTERVAL = "20 days"
76+
LOG_RETENTION_INTERVAL = "1 month"
77+
LOG_FORMAT = ("<level>{level: <8}</level>"
78+
" <green>{time:YYYY-MM-DD HH:mm:ss.SSS}</green>"
79+
" - <cyan>{name}</cyan>:<cyan>{function}</cyan>"
80+
" - <level>{message}</level>")

0 commit comments

Comments
 (0)