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