moccu / django-omnibus

django-omnibus is a Django library which helps to create websocket-based connections between a browser and a server to deliver messages.
BSD 3-Clause "New" or "Revised" License
70 stars 14 forks source link

django.utils.module_loading import import_by_path #32

Open ghost opened 7 years ago

ghost commented 7 years ago

$ ./manage.py omnibusd Traceback (most recent call last): File "./manage.py", line 22, in execute_from_command_line(sys.argv) File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/django/core/management/init.py", line 363, in execute_from_command_line utility.execute() File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/django/core/management/init.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/django/core/management/init.py", line 205, in fetch_command klass = load_command_class(app_name, subcommand) File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/django/core/management/init.py", line 40, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 978, in _gcd_import File "", line 961, in _find_and_load File "", line 950, in _find_and_load_unlocked File "", line 655, in _load_unlocked File "", line 678, in exec_module File "", line 205, in _call_with_frames_removed File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/omnibus/management/commands/omnibusd.py", line 4, in from django.utils.module_loading import import_by_path ImportError: cannot import name 'import_by_path'

Changed 3 years ago by Tim Graham timograham@… In d029fafea1a1f2f257397fbcd0fa3b531e09854f: Removed utils.module_loading.import_by_path() per deprecation timeline; refs #21674.

Was giving django-omnibus a go, and hit this import error. What are the version requirements for this product? Will Django 11.1 be supported?

ghost commented 7 years ago

ok a bit confused now

https://github.com/moccu/django-omnibus/blob/27e6ec453ea31304597ec65cc644e1c9d7f40ae0/omnibus/management/commands/omnibusd.py#L5

try: from django.utils.module_loading import import_string except ImportError: from django.utils.module_loading import import_by_path as import_string

And then tried this in shell

In [1]: from django.utils.module_loading import import_string

works.

pip installed django-omnibus==0.2.0

and has this at line 4

from django.utils.module_loading import import_by_path

So, looks like problem fixed in source but that hasn't been deployed upstream. Should I just pull from here, instead of getting pip version?