deploy-trig

This commit is contained in:
Untone 2024-01-15 11:19:37 +03:00
parent e312a3747c
commit 736569930b
2 changed files with 3 additions and 3 deletions

View File

@ -5,9 +5,10 @@ import aiohttp
from settings import API_BASE from settings import API_BASE
headers = {"Content-Type": "application/json"} headers = {"Content-Type": "application/json"}
api_base = API_BASE or "https://core.discours.io"
# TODO: rewrite to orm usage?
async def _request_endpoint(query_name, body) -> Any: async def _request_endpoint(query_name, body) -> Any:
async with aiohttp.ClientSession() as session: async with aiohttp.ClientSession() as session:
async with session.post(API_BASE, headers=headers, json=body) as response: async with session.post(API_BASE, headers=headers, json=body) as response:

View File

@ -2,8 +2,7 @@ from os import environ
PORT = 80 PORT = 80
DB_URL = ( DB_URL = (
environ.get("DATABASE_URL", "").replace("postgres://", "postgresql://") environ.get("DATABASE_URL", environ.get("DB_URL", "")).replace("postgres://", "postgresql://")
or environ.get("DB_URL", "").replace("postgres://", "postgresql://")
or "postgresql://postgres@localhost:5432/discoursio" or "postgresql://postgres@localhost:5432/discoursio"
) )
REDIS_URL = environ.get("REDIS_URL") or "redis://127.0.0.1" REDIS_URL = environ.get("REDIS_URL") or "redis://127.0.0.1"