Skip to content

Problem setting API key #175

@mattfriend

Description

@mattfriend

Hi there.
Firstly, thanks so much for creating this API wrapper - it's really useful.
I created a project using it about 2 years ago, and it worked beautifully.
However I'm now trying to make some amendments to that project, and I'm struggling to set my API key.
My project is a flask powered web app, so before launching the app I set an environmental variable:
METOFFICE_API_KEY=NNNNNNN-XXXX-YYYY-ZZZZ-AAAABBBBCCCC
I then have the following code to create a connection, per your examples:
metOfficeApiKey = os.environ.get("METOFFICE_API_KEY")
connection = datapoint.connection(api_key=metOfficeApiKey)

I'm getting the following error:
ValueError: Profile not found in /Users/Matt/Library/Application Support/DataPoint/default.key. Please install your API key with datapoint.profile.install_API_key("<YOUR-KEY>")

I'm still pretty new in web development so I'm not sure why I'm getting this error - could be because I've messed up my python environment? I'd hugely appreciate any thought you have on how to address this. Thanks so much in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions