007gzs/dingtalk-django-example

cannot import name 'generate_api_js'

iulmt opened this issue · 4 comments

iulmt commented

Traceback (most recent call last):
File "manage.py", line 23, in
execute_from_command_line(sys.argv)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/management/init.py", line 401, in execute_from_command_line
utility.execute()
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/management/init.py", line 395, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/management/base.py", line 328, in run_from_argv
self.execute(*args, **cmd_options)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/management/base.py", line 366, in execute
self.check()
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/management/base.py", line 395, in check
include_deployment_checks=include_deployment_checks,
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/management/base.py", line 382, in _run_checks
return checks.run_checks(**kwargs)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/checks/urls.py", line 13, in check_url_config
return check_resolver(resolver)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/core/checks/urls.py", line 23, in check_resolver
return check_method()
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/urls/resolvers.py", line 407, in check
for pattern in self.url_patterns:
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/urls/resolvers.py", line 588, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/utils/functional.py", line 48, in get
res = instance.dict[self.name] = self.func(instance)
File "/root/miniconda3/envs/ding/lib/python3.6/site-packages/django/urls/resolvers.py", line 581, in urlconf_module
return import_module(self.urlconf_name)
File "/root/miniconda3/envs/ding/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/dingtalk/example/urls.py", line 22, in
from apiview.common_view import generate_api_js
ImportError: cannot import name 'generate_api_js'

请问遇到同样的错误提示,是怎么解决的呢?

请问遇到同样的错误提示,是怎么解决的呢?

更新下master

解决了,需要修改example\urls.py

from apiview.common_view import generate_api_js
改为
#from apiview.common_view import generate_api_js

请问遇到同样的错误提示,是怎么解决的呢?

更新下master

谢谢!