启动时出现 Django-nonrel 错误:TypeError: __init__() 恰好需要 DatabaseFeatures 的 2 个参数(给定 1 个)

发布于 2024-10-05 19:44:33 字数 7338 浏览 2 评论 0原文

我刚刚从 django-nonrel 1fbce9199a32 升级到 496955a68561,现在尝试运行该应用程序时出现以下错误:

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3211, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3154, in _Dispatch
    base_env_dict=env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 527, in Dispatch
    base_env_dict=base_env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2404, in Dispatch
    self._module_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2314, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2212, in ExecuteOrImportScript
    script_module.main()
  File "/Users/mike/Projects/xxx/xxx/common-apps/djangoappengine/main/main.py", line 45, in real_main
    util.run_wsgi_app(application)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/util.py", line 97, in run_wsgi_app
    run_bare_wsgi_app(add_wsgi_middleware(application))
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/util.py", line 115, in run_bare_wsgi_app
    result = application(env, _start_response)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/core/handlers/wsgi.py", line 265, in __call__
    response = self.get_response(request)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/core/handlers/base.py", line 160, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/core/handlers/base.py", line 194, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/views/debug.py", line 58, in technical_500_response
    html = reporter.get_traceback_html()
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/views/debug.py", line 109, in get_traceback_html
    frames = self.get_traceback_frames()
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/views/debug.py", line 228, in get_traceback_frames
    pre_context_lineno, pre_context, context_line, post_context = self._get_lines_from_file(filename, lineno, 7, loader, module_name)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/views/debug.py", line 180, in _get_lines_from_file
    source = loader.get_source(module_name)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1954, in get_source
    full_path, search_path, submodule = self.GetModuleInfo(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1918, in GetModuleInfo
    submodule, search_path = self.GetParentSearchPath(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1897, in GetParentSearchPath
    parent_package = self.GetParentPackage(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1873, in GetParentPackage
    if self.find_module(fullname) is None:
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1603, in find_module
    search_path)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1841, in FindAndLoadModule
    description)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1792, in LoadModuleRestricted
    description)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/db/__init__.py", line 77, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/db/utils.py", line 92, in __getitem__
    conn = backend.DatabaseWrapper(db, alias)
  File "/Users/mike/Projects/xxx/xxx/common-apps/djangoappengine/db/base.py", line 118, in __init__
    self.features = DatabaseFeatures()
TypeError: __init__() takes exactly 2 arguments (1 given)

I just upgraded from django-nonrel 1fbce9199a32 to 496955a68561, and I'm now getting the following errors when trying to run the app:

Traceback (most recent call last):
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3211, in _HandleRequest
    self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 3154, in _Dispatch
    base_env_dict=env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 527, in Dispatch
    base_env_dict=base_env_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2404, in Dispatch
    self._module_dict)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2314, in ExecuteCGI
    reset_modules = exec_script(handler_path, cgi_path, hook)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 2212, in ExecuteOrImportScript
    script_module.main()
  File "/Users/mike/Projects/xxx/xxx/common-apps/djangoappengine/main/main.py", line 45, in real_main
    util.run_wsgi_app(application)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/util.py", line 97, in run_wsgi_app
    run_bare_wsgi_app(add_wsgi_middleware(application))
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/webapp/util.py", line 115, in run_bare_wsgi_app
    result = application(env, _start_response)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/core/handlers/wsgi.py", line 265, in __call__
    response = self.get_response(request)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/core/handlers/base.py", line 160, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/core/handlers/base.py", line 194, in handle_uncaught_exception
    return debug.technical_500_response(request, *exc_info)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/views/debug.py", line 58, in technical_500_response
    html = reporter.get_traceback_html()
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/views/debug.py", line 109, in get_traceback_html
    frames = self.get_traceback_frames()
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/views/debug.py", line 228, in get_traceback_frames
    pre_context_lineno, pre_context, context_line, post_context = self._get_lines_from_file(filename, lineno, 7, loader, module_name)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/views/debug.py", line 180, in _get_lines_from_file
    source = loader.get_source(module_name)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1954, in get_source
    full_path, search_path, submodule = self.GetModuleInfo(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1918, in GetModuleInfo
    submodule, search_path = self.GetParentSearchPath(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1897, in GetParentSearchPath
    parent_package = self.GetParentPackage(fullname)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1873, in GetParentPackage
    if self.find_module(fullname) is None:
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1603, in find_module
    search_path)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1841, in FindAndLoadModule
    description)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1289, in Decorate
    return func(self, *args, **kwargs)
  File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/tools/dev_appserver.py", line 1792, in LoadModuleRestricted
    description)
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/db/__init__.py", line 77, in <module>
    connection = connections[DEFAULT_DB_ALIAS]
  File "/Users/mike/Projects/xxx/xxx/common-apps/django/db/utils.py", line 92, in __getitem__
    conn = backend.DatabaseWrapper(db, alias)
  File "/Users/mike/Projects/xxx/xxx/common-apps/djangoappengine/db/base.py", line 118, in __init__
    self.features = DatabaseFeatures()
TypeError: __init__() takes exactly 2 arguments (1 given)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坦然微笑 2024-10-12 19:44:33

(Base)DatabaseFeatures需要一个连接参数;如果没有参数,你就不能(再?)构造它。

(Base)DatabaseFeatures requires a connection parameter; you can't construct it (anymore?) without parameters.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文