DEV Community

Discussion on: Microservice in Python using FastAPI

Collapse
 
bagonzalo profile image
Curated

Major bugs:
(1) you need to initialize first de dabases in the "docker-compose.yml". Otherwise the services try to conect (in my case) to them without being initialize.
(2) change DATABASE_URL for DATABASE_URI here:
"""

~/python-microservices/movie-service/app/api/db.py

import os

from sqlalchemy import (Column, DateTime, Integer, MetaData, String, Table,
create_engine, ARRAY)

from databases import Database

DATABASE_URL = os.getenv('DATABASE_URL')
"""

Collapse
 
bagonzalo profile image
Curated

And thanks indeed for the post.

Collapse
 
uwevanopfern profile image
UweVanOpfern

Helped me, a lot, thanks