GetStream / stream-django

Django Client - Build Activity Feeds & Streams with GetStream.io
https://getstream.io
BSD 3-Clause "New" or "Revised" License
452 stars 80 forks source link

Getting GetStreamAPI404 error #76

Closed triump0870 closed 6 years ago

triump0870 commented 6 years ago

I have set the STREAM_API_KEY and STREAM_API_SECRET but when I try to add the activity I am getting this error,

StreamApiException: GetStreamAPI404

File "/Users/rohanroy/development/django/zappa/appcore/src/apis/views.py", line 682, in perform_create
    serializer.save(author=self.request.user)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/rest_framework/serializers.py", line 214, in save
    self.instance = self.create(validated_data)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/rest_framework/serializers.py", line 917, in create
    instance = ModelClass.objects.create(**validated_data)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/django/db/models/query.py", line 394, in create
    obj.save(force_insert=True, using=self.db)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/django/db/models/base.py", line 808, in save
    force_update=force_update, update_fields=update_fields)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/django/db/models/base.py", line 848, in save_base
    update_fields=update_fields, raw=raw, using=using,
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 193, in send
    for receiver in self._live_receivers(sender)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/stream_django/managers.py", line 82, in activity_created
    return self.add_activity_to_feed(instance)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/stream_django/managers.py", line 64, in add_activity_to_feed
    result = feed.add_activity(activity)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/stream/feed.py", line 59, in add_activity
    self.feed_url, data=activity_data, signature=token)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/stream/client.py", line 258, in post
    return self._make_request(self.session.post, *args, **kwargs)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/stream/client.py", line 212, in _make_request
    return self._parse_response(response)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/stream/client.py", line 152, in _parse_response
    self.raise_exception(parsed_result, status_code=response.status_code)
  File "/Users/rohanroy/development/django/zappa/arete/lib/python2.7/site-packages/stream/client.py", line 252, in raise_exception
    raise exception
StreamApiException: GetStreamAPI404

Please help me guys.

triump0870 commented 6 years ago

stream-django uses the stream-python library which actually looks for an environment variable LOCAL if it finds it then it assumes that the stream server is a local server. Unfortunately, I was using LOCAL variable as an environment local development purpose. While digging inside the library I found it and removed it. Since then it started working as expected.