Stream-framework требует django?
Я изучаю стрим-фреймворк. Я выполнил руководство и создал базовую ленту, как показано ниже.
from stream_framework.feeds.redis import RedisFeed
class PinFeed(RedisFeed):
key_format = 'feed:normal:%(user_id)s'
class UserPinFeed(PinFeed):
key_format = 'feed:user:%(user_id)s'
feed = UserPinFeed(13)
Я получил ошибку ниже
`Traceback (most recent call last):
File "D:\CommonFiles\Python37\lib\site-packages\stream_framework\settings.py", line 26, in import_global_module
objects = getattr(module, '__all__', dir(module))
File "D:\CommonFiles\Python37\lib\site-packages\django\utils\functional.py", line 224, in inner
self._setup()
File "D:\CommonFiles\Python37\lib\site-packages\django\conf\__init__.py", line 61, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested settings, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\X\Desktop\sd.py", line 1, in <module>
from stream_framework.feeds.redis import RedisFeed
File "D:\CommonFiles\Python37\lib\site-packages\stream_framework\feeds\redis.py", line 1, in <module>
from stream_framework.feeds.base import BaseFeed
File "D:\CommonFiles\Python37\lib\site-packages\stream_framework\feeds\base.py", line 7, in <module>
from stream_framework.storage.base import BaseActivityStorage, BaseTimelineStorage
File "D:\CommonFiles\Python37\lib\site-packages\stream_framework\storage\base.py", line 10, in <module>
class BaseStorage(object):
File "D:\CommonFiles\Python37\lib\site-packages\stream_framework\storage\base.py", line 36, in BaseStorage
metrics = get_metrics_instance()
File "D:\CommonFiles\Python37\lib\site-packages\stream_framework\utils\__init__.py", line 146, in get_metrics_instance
from stream_framework import settings
File "D:\CommonFiles\Python37\lib\site-packages\stream_framework\settings.py", line 45, in <module>
import_global_module(settings, locals(), globals())
File "D:\CommonFiles\Python37\lib\site-packages\stream_framework\settings.py", line 31, in import_global_module
except exceptions as e:
TypeError: catching classes that do not inherit from BaseException is not allowed`
- Как мне исправить эту ошибку?
- Требуется ли для stream-framework django?
- Учебник по Stream-framework трудно понять, так как я новичок. Есть ли учебник, в котором код построчно объясняется?
- Есть ли хорошая альтернатива stream-framework, которую я могу использовать для ленты социальных сетей?