Flask ValueError: invalid literal for int() with base 10: '(db_port)'
I'm trying to build the note taking app as described in Linux academy's Introduction to Python Development.
When doing the flask db migrate part of the "Modeling Data with an Object-Relational Mapper" lecture. I get" ValueError: invalid literal for int() with base 10: '(db_port)'"
.env file:
export DB_USERNAME='dbuser'
export DB_PASSWORD='Supersecret1234'
export DB_HOST='External IP goes here (removed for privacy reasons)'
export DB_PORT='80'
export FLASK_ENV='development'
export FLASK_APP='.'
config.py file:
import os
db_host = os.environ.get('DB_HOST', default='localhost')
db_name = os.environ.get('DB_NAME', default='notes')
db_user = os.environ.get('DB_USERNAME', default='notes')
db_password = os.environ.get('DB_PASSWORD', default='')
db_port = os.environ.get('DB_PORT', default='5432')
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_DATABASE_URI = f"postgres://(db_user):(db_password)@(db_host):(db_port)/(db_name)"
Does anyone have an idea what I'm missing?
I'm using python3.8 if that matters.
Posted Dec 1, 2019, 1:55 PM UTC
24