Replies: 3 comments 3 replies
-
@diana0809 please be more descriptive about what you're trying to achieve or what result you're expecting |
Beta Was this translation helpful? Give feedback.
2 replies
-
I want to connect the postgresql. when I write the database'name 、user and password to the .env file,error occured. StacApi ' settings is also in the .env file. I don't know that these settings should be used.发自我的荣耀手机-------- 原始邮件 --------发件人: Vincent Sarago ***@***.***>日期: 2025年4月23日周三 傍晚5:46收件人: stac-utils/stac-fastapi-pgstac ***@***.***>抄送: Diana ***@***.***>, Mention ***@***.***>主 题: Re: [stac-utils/stac-fastapi-pgstac] PostgresSettings & ApiSettings (Discussion #233)
@diana0809 please be more descriptive about what you're trying to achieve or what result you're expecting
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Did you try running the default application defined in stac_fastapi/pgstac/app.py? From your local environment with that .env file set up you should be able to run You can also run it in the docker network with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
from stac_fastapi.pgstac.config import PostgresSettings
from stac_fastapi.types.config import ApiSettings
I created the .env file that contains Postgres'configs and ApiSetings, as follows:
for postgres
POSTGRES_USER="username"
POSTGRES_PASS="password"
POSTGRES_HOST_READER="10.28.18.21"
POSTGRES_HOST_WRITER="10.28.18.21"
POSTGRES_PORT="5439"
POSTGRES_DBNAME="postgis"
for STAC API
STAC_API_TITLE="My STAC API"
STAC_API_DESCRIPTION="A STAC API powered by pgstac"
STAC_API_VERSION="1.0.0"
the code is as follows:
load_dotenv()
api = StacApi(
app=app,
client=CoreCrudClient(),
settings=settings,
extensions=[
QueryExtension()
]
)
How to use PostgresSettings and ApiSetings
Beta Was this translation helpful? Give feedback.
All reactions