Skip to content

Instantly share code, notes, and snippets.

@dario61081
Created March 16, 2018 16:32
Show Gist options
  • Save dario61081/9ed0d60958123401750b12beba4578f1 to your computer and use it in GitHub Desktop.
Save dario61081/9ed0d60958123401750b12beba4578f1 to your computer and use it in GitHub Desktop.
Configuracion flask via object
# Archivo de configuracion de entornos
import os
class Config(object):
DEBUG = False
TESTING = False
SECRET_KEY = os.urandom(9990999)
ALLOWED_EXTENSIONS = {'txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif', 'fbk'}
JINJA_ENV_CACHE = None
TRIM_BLOCKS = True
LSTRIP_BLOCKS = True
AUTOESCAPE = True
UPLOAD_FOLDER = os.path.join(os.path.dirname(__file__), 'uploads')
HOST = '0.0.0.0'
PORT = 5000
LOCALE = 'esp_esp'
# app.jinja_env.trim_blocks = True
# app.jinja_env.lstrip_blocks = True
# app.jinja_env.autoescape = True
# upload_folder = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'uploads')
# upload_folder =
# print "upload folder: ", upload_folder
class DevelopmentConfig(Config):
DEBUG = True
TESTING = False
class ProductionConfig(Config):
DEBUG = False
TESTING = False
class TestingConfig(Config):
DEBUG = False
TESTING = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment