-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
26 lines (21 loc) · 1.03 KB
/
config.py
File metadata and controls
26 lines (21 loc) · 1.03 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
import os
import oauthlib.oauth1
from dotenv import load_dotenv
# Registra la aplicación en https://www.openstreetmap.org/user/<username>/oauth_clients/new
# En "URL de la aplicación principal" debes poner: http://localhost:8080
# y marcar la opción "leer sus preferencias de usuario"
# Crea el archivo .env.development.local con las variables:
# OSM_CLIENT_ID = "Clave de Consumidor"
# OSM_CLIENT_SECRET = "Secreto de Consumidor"
load_dotenv(".env")
load_dotenv(f".env.{os.getenv('FLASK_ENV', 'production')}")
load_dotenv(f".env.{os.getenv('FLASK_ENV', 'production')}.local", override=True)
class Config:
SECRET_KEY = os.getenv("FLASK_SECRET_KEY", None)
OSM_CLIENT_ID = os.getenv("OSM_CLIENT_ID", "")
OSM_CLIENT_SECRET = os.getenv("OSM_CLIENT_SECRET", "")
OSM_URL = os.getenv('OSM_URL', 'https://www.openstreetmap.org')
SESSION_COOKIE_SAMESITE = "Lax"
MAX_CONTENT_LENGTH = 10 * 1024 * 1024 # 10 Mb
API_URL = os.getenv("API_URL", "http://127.0.0.1:5000")
CLIENT_URL = os.getenv("CLIENT_URL", "http://127.0.0.1:8080")