[FastAPI] postgreSQL 연결하기


[FastAPI] postgreSQL 연결하기

데이터베이스 연결 "postgreSQL" 연결시 비밀번호 마지막에 특수문자 포함되어 있으면, 그 다음에 오는 "@{host}" 이 부분과 오류가 발생한다. 아직 명확한 해결방법은 찾지 못하여, 비밀번호를 간단하게 변경했다. engine = create_engine("postgresql://{username}:{password}@{host}:{port}/{db_name}".format( username='postgres', password='postgres', host='127.0.0.1', port='5432', db_name='테이블이름' )) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) Base = declarative_base()...


#fastapi #postgres #postgresql #python

원문링크 : [FastAPI] postgreSQL 연결하기