Jay
03/28/2024, 3:03 AMfrom prefect_sqlalchemy import SqlAlchemyConnector, ConnectionComponents, SyncDriver
from prefect.blocks.system import Secret
connector = SqlAlchemyConnector(
connection_info=ConnectionComponents(
driver=SyncDriver.POSTGRESQL_PSYCOPG2,
username="prefect",
password=Secret.load("tradesys-db-password").get(),
host="<http://xxx.xxx.xxx.xxx|xxx.xxx.xxx.xxx>",
port=5432,
database="prefect",
)
)
connector.save("tradesys-db-connector")
and saving my connector keeps getting a 403 error. I am self hosted with prefect running in a docker on my server, and I am running this script from my laptop. Secrect.load() seems to be working, and I have been using my server with other scripts, so seems to just be an issue with this
prefect.exceptions.PrefectHTTPStatusError: Client error '403 Forbidden' for url '<http://xxx.xxx.xxx.xxx:4200/api/block_types/>'
Response: {'detail': 'Missing CSRF token.'}
Jay
03/28/2024, 4:11 AM