-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.py
33 lines (22 loc) · 960 Bytes
/
constants.py
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
import os
from datetime import timezone
SECRET_KEY_FILENAME = "secretkey.dat"
BCRYPT_ROUNDS = 14
APP_DIR = os.path.dirname(os.path.abspath(__file__) ) #This is the directory of the project
PROJECTS_FOLDER = os.path.join(APP_DIR,"projects")
SHARE_URL_SIZE = 12
TIME_FORMAT = "%Y-%m-%d %H:%M:%S.%f %Z"
TIMEZONE = timezone.utc
THUMBNAIL_EXTENSIONS = ["png","jpeg","jpg","gif"]
ALLOWED_EMAIL_DOMAINS = ["burnside.school.nz"]
#Google Login id and secret
GOOGLE_CLIENT_ID = os.environ.get("GOOGLE_CLIENT_ID")
GOOGLE_CLIENT_SECRET = os.environ.get("GOOGLE_CLIENT_SECRET")
GOOGLE_DISCOVERY_URL = ("https://accounts.google.com/.well-known/openid-configuration")
#Error responses:
VIOLATION_ERROR = ("You do not have permission to perform this request.", 403)
#Max file sizes in megabytes:
MAX_THUMBNAIL_SIZE_MB = 0.4
MAX_CONTENT_SIZE_MB = 10
MAX_DOWNLOAD_SIZE_MB = 10
MAX_UPLOAD_SIZE_MB = max(MAX_THUMBNAIL_SIZE_MB, MAX_CONTENT_SIZE_MB, MAX_DOWNLOAD_SIZE_MB)