Spaces:
Sleeping
Sleeping
Download database.py from pdrMottaS/afabd-ts02: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/spaces/pdrMottaS/afabd-ts02/resolve/main/database.py
- Command line
-
hf download hf://spaces/pdrMottaS/afabd-ts02/database.py
-
curl -L -o database.py https://huggingface.co/spaces/pdrMottaS/afabd-ts02/resolve/main/database.py
434 Bytes
| from sqlalchemy import create_engine | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import sessionmaker | |
| import configuration | |
| if configuration.ENV == 'test': | |
| database_url = configuration.DATABASE_URL_TEST | |
| else: | |
| database_url = configuration.DATABASE_URL_PROD | |
| engine = create_engine(database_url) | |
| SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine) | |
| Base = declarative_base() |