changed configurations

parent 835a41a0
...@@ -4,7 +4,7 @@ from fastapi import FastAPI ...@@ -4,7 +4,7 @@ from fastapi import FastAPI
from tortoise.contrib.fastapi import register_tortoise from tortoise.contrib.fastapi import register_tortoise
TORTOISE_ORM = { TORTOISE_ORM = {
'connections': {'default': os.environ.get('database_url')}, 'connections': {'default': os.environ.get('DATABASE_URL')},
'apps': { 'apps': {
'models': { 'models': {
'models': ['src.app.db.models', 'aerich.models'], 'models': ['src.app.db.models', 'aerich.models'],
...@@ -17,7 +17,7 @@ TORTOISE_ORM = { ...@@ -17,7 +17,7 @@ TORTOISE_ORM = {
def init_db(app: FastAPI) -> None: def init_db(app: FastAPI) -> None:
register_tortoise( register_tortoise(
app, app,
db_url=os.environ.get('database_url'), db_url=os.environ.get('DATABASE_URL'),
modules={"models": ["db.models"]}, modules={"models": ["db.models"]},
generate_schemas=False, generate_schemas=False,
add_exception_handlers=True, add_exception_handlers=True,
......
...@@ -3,4 +3,4 @@ import os ...@@ -3,4 +3,4 @@ import os
import pydantic import pydantic
database_url = pydantic.PostgresDsn(os.getenv('database_url')) database_url = pydantic.PostgresDsn(os.getenv('DATABASE_URL'))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment