-3

I am unable to access an existing database of faunadb using python in the pycharm editor. I have secret key, collection and indexes as inputs.

I wrote a simple code using python to access the database using the three credentials.

1 Answers1

1

If you already have your code in PyCharm inside a project:

  1. Install the latest fauna package from Package Manager, equivalent to pip install fauna
  2. Go to Fauna's dashboard, login, and create a database
  3. Click on the database, hover over its name, and click the key icon
  4. Click Create Key, enter a name for the key and a role (for now, Server is ok). Copy the generated key, it starts with fn*.
  5. Create a run configuration for your *.py file, and add FAUNA_SECRET as an environment variable, with the key value you created on Step 4 above.

That should do it. If you want to test it with a sample, use the snippets at https://docs.fauna.com/fauna/current/get_started/client_quick_start?lang=python on the documentation.

More info about the latest driver at https://github.com/fauna/fauna-python - you'll find additional code samples there.

Also: the only "credential" you need is the key (step 3) - you don't need a specific collection and index to connect - those are part of your query. :)

Other questions? Try our forum at https://forums.fauna.com or our Discord at https://discord.gg/faunainc and find me there. - Luis@Fauna

Luis Colon
  • 801
  • 7
  • 4