Connect to weaviate cluster

Hi there!

Recently I've created a flask app on PythonAnywhere. Now I'm trying to connect the app to a Weaviate cluster, from where it would retrieve data and pass it through to an API (which I still need to build).

I'm receiving errors on the connection part. Such as:

site-packages/weaviate/connect/", line 653, in wait_for_weaviate
    raise Weaviat`enter code here`eStartUpError(
weaviate.exceptions.WeaviateStartUpError: Weaviate did not start up in 15 seconds. Either the Weaviate URL is wrong or Weaviate did not start up in the interval given in 'startup_period'.

In my flask app should authenticate the acces:

auth_config = weaviate.AuthApiKey(api_key=WEAVIATE_API_KEY)

client = weaviate.Client(
    additional_headers={"X-OpenAI-Api-Key": OPENAI_API_KEY},
    startup_period = 15

Yet this doesn't seem to work.

I'm rather new in this domain of coding, so any general advice on whether this is possible at all would be welcome!



Try running the code that connects to weaviate in a console instead of in your web app and see if that changes anything.

This worked, thanks!

Glad to hear that!