Skip to content

Can not use DataRoomClient despite creating an admin account + generating an API KEY #3

@BelhalK

Description

@BelhalK

The code in client_example.ipynb

for i, url in enumerate(urls):
    image = await DataRoom.create_image(image_id=f'notebook-{i}', image_url=url, source='website')
    print(image['id'])

returns

DataRoomError: Client error '403 Forbidden' for url 'http://localhost:8000/api/images/'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403
403
{"detail":"Invalid token."}

despite having created an admin account with my email address and having generated an API_KEY using

from django.contrib.auth import get_user_model
User = get_user_model()
user = User.objects.get(email="my_email")  

from rest_framework.authtoken.models import Token
token, created = Token.objects.get_or_create(user=user)
print(token.key)

inside the shell terminal (docker compose run --rm dataroom_django python manage.py shell) while dev server is running.

Please advise.

Thank you team!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions