-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
34 lines (25 loc) · 939 Bytes
/
Copy pathconfig.py
File metadata and controls
34 lines (25 loc) · 939 Bytes
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
import os
from dotenv import load_dotenv
basedir = os.path.abspath(os.path.dirname(__file__))
load_dotenv(os.path.join(basedir, '.env'))
class Config:
"""Base config."""
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = os.environ.get("SECRET_KEY")
UPLOAD_PATH = 'static/post_images/'
UPLOAD_FOLDER = 'static/images/profile/'
MAX_CONTENT_LENGTH = 2 * 1024 * 1024
UPLOAD_EXTENSIONS = ['.jpg', '.png', '.gif']
#SESSION_COOKIE_NAME = os.environ.get('SESSION_COOKIE_NAME')
STATIC_FOLDER = 'static'
TEMPLATES_FOLDER = 'templates'
class ProConfig(Config):
FLASK_ENV = 'production'
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', '').replace('postgres://', 'postgresql://')
class DevConfig(Config):
FLASK_ENV = 'development'
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ.get("SQLALCHEMY_DATABASE_URI", "")