Untitled
13 hours ago in Plain Text
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
{ % block content % }
{ % endblock % }
</body>
</html>
POSTGRES_USER=admin
POSTGRES_PASSWORD=adminpassword
POSTGRES_DB=mydatabase
POSTGRES_HOST=localhost
version: '3.8'
services:
postgres:
image: postgres
container_name: my_postgres
restart: always
environment:
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
POSTGRES_DB: mydatabase
ports:
- "5432:5432"
networks:
- pg_network
pgadmin:
image: dpage/pgadmin4
container_name: my_pgadmin
restart: always
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: admin123
ports:
- "5050:80"
depends_on:
- postgres
networks:
- pg_network
networks:
pg_network:
driver: bridge
from fastapi import FastAPI
from fastapi.templating import Jinja2Templates
app = FastAPI()
templates = Jinja2Templates(directory="templates")
@app.get("/", response_class=HTMLResponse)
def home(request: Request):
return templates.TemplateResponse(
request=request, name="item.html", context={"id":id}
)