Skip to content

Commit

Permalink
Configuração para rodar local
Browse files Browse the repository at this point in the history
  • Loading branch information
RCristiano committed Nov 29, 2021
1 parent 91844c8 commit fae7880
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions apps/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ class Config(object):
basedir = os.path.abspath(os.path.dirname(__file__))

# Set up the App SECRET_KEY
SECRET_KEY = config('SECRET_KEY', default='S#perS3crEt_007')
SECRET_KEY = config("SECRET_KEY", default="S#perS3crEt_007")

# This will create a file in <app> FOLDER
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + \
os.path.join(basedir, 'db.sqlite3')
SQLALCHEMY_DATABASE_URI = "sqlite:///" + os.path.join(
basedir, "db.sqlite3"
)
SQLALCHEMY_TRACK_MODIFICATIONS = False


Expand All @@ -29,14 +30,15 @@ class ProductionConfig(Config):
REMEMBER_COOKIE_DURATION = 3600

# PostgreSQL database
SQLALCHEMY_DATABASE_URI = config('DATABASE_URL', default=False) or \
'{}://{}:{}@{}:{}/{}'.format(
config('DB_ENGINE', default='postgresql'),
config('DB_USERNAME', default='appseed'),
config('DB_PASS', default='pass'),
config('DB_HOST', default='localhost'),
config('DB_PORT', default=5432),
config('DB_NAME', default='appseed-flask')
SQLALCHEMY_DATABASE_URI = config(
"DATABASE_URL", default=False
) or "{}://{}:{}@{}:{}/{}".format(
config("DB_ENGINE", default="postgresql"),
config("DB_USERNAME", default="agenteagenda"),
config("DB_PASS", default="pass"),
config("DB_HOST", default="localhost"),
config("DB_PORT", default=5432),
config("DB_NAME", default="agenteagenda-flask"),
)


Expand All @@ -45,7 +47,4 @@ class DebugConfig(Config):


# Load all possible configurations
config_dict = {
'Production': ProductionConfig,
'Debug': DebugConfig
}
config_dict = {"Production": ProductionConfig, "Debug": DebugConfig}

0 comments on commit fae7880

Please sign in to comment.