-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.py
59 lines (48 loc) · 1.78 KB
/
config.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
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
from decouple import config
import os
class Config:
pass
class ProductionConfig(Config):
# Get environment variables defined in app.yaml
db_user = os.environ.get('CLOUD_SQL_USERNAME')
db_password = os.environ.get('CLOUD_SQL_PASSWORD')
db_name = os.environ.get('CLOUD_SQL_DATABASE_NAME')
db_connection_name = os.environ.get('CLOUD_SQL_CONNECTION_NAME')
DEBUG = False
SQLALCHEMY_DATABASE_URI = (
'mysql+pymysql://{user}:{password}@localhost/{database}'
'?unix_socket=/cloudsql/{connection_name}').format(
user=db_user, password=db_password,
database=db_name, connection_name=db_connection_name)
SQLALCHEMY_TRACK_MODIFICATIONS = False
STATIC_FOLDER = "/static"
TEMPLATE_FOLDER = "/templates"
SECRET_KEY = config('SECRET_KEY', default='localhost')
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///data.db'
"""
# Si no acabase de ir con sqlite cambiar a esto y preguntar a MarcS como usarlo
SQLALCHEMY_DATABASE_URI = (
'mysql+pymysql://{user}:{password}@localhost/{database}').format(
user=db_user, password=db_password,
database=db_name)
"""
SQLALCHEMY_TRACK_MODIFICATIONS = False
STATIC_FOLDER = "/frontend/dist/static"
TEMPLATE_FOLDER = "/frontend/dist"
SECRET_KEY = "kdsfklsmfakfmafmadslvsdfasdf"
class TestingConfig(Config):
DEBUG = True
TESTING = True
SQLALCHEMY_DATABASE_URI = 'sqlite:///testing.db'
SQLALCHEMY_TRACK_MODIFICATIONS = False
WTF_CSRF_ENABLED = False
STATIC_FOLDER = "/frontend/dist/static"
TEMPLATE_FOLDER = "/frontend/dist"
SECRET_KEY = "kdsfklsmfakfmafmadslvsdfasdf"
config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'testing': TestingConfig
}