You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following successful completion of all prerequisite steps, when I run the database migrations, I get the following error:
[root@localhost netbox]# python3 manage.py migrate
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 180, in import_from_string
module = import_module(module_path)
File "/usr/lib64/python3.4/importlib/init.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2254, in _gcd_import
File "", line 2237, in _find_and_load
File "", line 2226, in _find_and_load_unlocked
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "/opt/netbox-2.1.5/netbox/utilities/api.py", line 7, in
from rest_framework.compat import is_authenticated
ImportError: cannot import name 'is_authenticated'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/lib/python3.4/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/lib/python3.4/site-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 327, in execute
self.check()
File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/usr/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
issues.extend(super(Command, self)._run_checks(**kwargs))
File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/usr/lib/python3.4/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/lib/python3.4/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/usr/lib/python3.4/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/usr/lib/python3.4/site-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/usr/lib/python3.4/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/lib/python3.4/site-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/lib/python3.4/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/lib/python3.4/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib64/python3.4/importlib/init.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2254, in _gcd_import
File "", line 2237, in _find_and_load
File "", line 2226, in _find_and_load_unlocked
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "/opt/netbox-2.1.5/netbox/netbox/urls.py", line 3, in
from rest_framework_swagger.views import get_swagger_view
File "/usr/lib/python3.4/site-packages/rest_framework_swagger/views.py", line 5, in
from rest_framework.schemas import SchemaGenerator
File "/usr/lib/python3.4/site-packages/rest_framework/schemas/init.py", line 32, in
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 223, in getattr
val = perform_import(val, attr)
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 168, in perform_import
return [import_from_string(item, setting_name) for item in val]
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 168, in
return [import_from_string(item, setting_name) for item in val]
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 184, in import_from_string
raise ImportError(msg)
ImportError: Could not import 'utilities.api.TokenAuthentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'. ImportError: cannot import name 'is_authenticated'.
I also got the same exact error when running Python 3.6.2.
The text was updated successfully, but these errors were encountered:
WRJFontenot
changed the title
ImportError: cann ot import name 'is_authenticated' when running 'manage.py migrate' command
ImportError: cannot import name 'is_authenticated' when running 'manage.py migrate' command
Oct 7, 2017
Issue type
[ ] Feature request
[X ] Bug report
[ ] Documentation
Environment
Description
Following successful completion of all prerequisite steps, when I run the database migrations, I get the following error:
[root@localhost netbox]# python3 manage.py migrate
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 180, in import_from_string
module = import_module(module_path)
File "/usr/lib64/python3.4/importlib/init.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2254, in _gcd_import
File "", line 2237, in _find_and_load
File "", line 2226, in _find_and_load_unlocked
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "/opt/netbox-2.1.5/netbox/utilities/api.py", line 7, in
from rest_framework.compat import is_authenticated
ImportError: cannot import name 'is_authenticated'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/usr/lib/python3.4/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/usr/lib/python3.4/site-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 327, in execute
self.check()
File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 359, in check
include_deployment_checks=include_deployment_checks,
File "/usr/lib/python3.4/site-packages/django/core/management/commands/migrate.py", line 62, in _run_checks
issues.extend(super(Command, self)._run_checks(**kwargs))
File "/usr/lib/python3.4/site-packages/django/core/management/base.py", line 346, in _run_checks
return checks.run_checks(**kwargs)
File "/usr/lib/python3.4/site-packages/django/core/checks/registry.py", line 81, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/lib/python3.4/site-packages/django/core/checks/urls.py", line 16, in check_url_config
return check_resolver(resolver)
File "/usr/lib/python3.4/site-packages/django/core/checks/urls.py", line 26, in check_resolver
return check_method()
File "/usr/lib/python3.4/site-packages/django/urls/resolvers.py", line 254, in check
for pattern in self.url_patterns:
File "/usr/lib/python3.4/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/lib/python3.4/site-packages/django/urls/resolvers.py", line 405, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/lib/python3.4/site-packages/django/utils/functional.py", line 35, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/lib/python3.4/site-packages/django/urls/resolvers.py", line 398, in urlconf_module
return import_module(self.urlconf_name)
File "/usr/lib64/python3.4/importlib/init.py", line 109, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 2254, in _gcd_import
File "", line 2237, in _find_and_load
File "", line 2226, in _find_and_load_unlocked
File "", line 1200, in _load_unlocked
File "", line 1129, in _exec
File "", line 1471, in exec_module
File "", line 321, in _call_with_frames_removed
File "/opt/netbox-2.1.5/netbox/netbox/urls.py", line 3, in
from rest_framework_swagger.views import get_swagger_view
File "/usr/lib/python3.4/site-packages/rest_framework_swagger/views.py", line 5, in
from rest_framework.schemas import SchemaGenerator
File "/usr/lib/python3.4/site-packages/rest_framework/schemas/init.py", line 32, in
authentication_classes=api_settings.DEFAULT_AUTHENTICATION_CLASSES,
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 223, in getattr
val = perform_import(val, attr)
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 168, in perform_import
return [import_from_string(item, setting_name) for item in val]
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 168, in
return [import_from_string(item, setting_name) for item in val]
File "/usr/lib/python3.4/site-packages/rest_framework/settings.py", line 184, in import_from_string
raise ImportError(msg)
ImportError: Could not import 'utilities.api.TokenAuthentication' for API setting 'DEFAULT_AUTHENTICATION_CLASSES'. ImportError: cannot import name 'is_authenticated'.
I also got the same exact error when running Python 3.6.2.
The text was updated successfully, but these errors were encountered: