【问题标题】:LookupError: No installed app with label 'mobile_backend/'LookupError:没有安装带有标签“mobile_backend/”的应用程序
【发布时间】:2015-03-12 09:29:15
【问题描述】:

我将 django 与应用引擎和数据存储一起使用。

我想测试应用程序,因为我已经更改了我的设置,不为测试创建本地数据库。 在setting.py中:

TEST_RUNNER = 'testing.DatabaselessTestRunner'

在 testing.py 中

    """Support for testing."""

from django.test.simple import DjangoTestSuiteRunner

class DatabaselessTestRunner(DjangoTestSuiteRunner):
    """A test suite runner that does not set up and tear down a database."""

    def setup_databases(self):
        """Overrides DjangoTestSuiteRunner"""
        pass

    def teardown_databases(self, *args):
        """Overrides DjangoTestSuiteRunner"""
        pass

当我运行时:python manage.py test mobile_backend/

我有一个奇怪的错误:

raise LookupError("No installed app with label '%s'." % app_label)
LookupError: No installed app with label 'mobile_backend/'.

但在我的 setting.py 中,我已将“'mobile_backend'”添加到我的 INSTALLED_APPS

有人可以帮助我吗?

谢谢

编辑

我的错误的完整堆栈跟踪:

/usr/local/lib/python2.7/dist-packages/django/test/_doctest.py:59: RemovedInDjango18Warning: The django.test._doctest module is deprecated; use the doctest module from the Python standard library instead.   RemovedInDjango18Warning)

/usr/local/lib/python2.7/dist-packages/django/test/simple.py:27: RemovedInDjango18Warning: The django.test.simple module and DjangoTestSuiteRunner are deprecated; use django.test.runner.DiscoverRunner instead.   RemovedInDjango18Warning)

Traceback (most recent call last):   File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)   File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()   File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)   File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/test.py", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)   File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)   File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/test.py", line 71, in execute
    super(Command, self).execute(*args, **options)   File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)   File "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/test.py", line 88, in handle
    failures = test_runner.run_tests(test_labels)   File "/usr/local/lib/python2.7/dist-packages/django/test/runner.py", line 146, in run_tests
    suite = self.build_suite(test_labels, extra_tests)   File "/usr/local/lib/python2.7/dist-packages/django/test/simple.py", line 241, in build_suite
    app_config = apps.get_app_config(label)   File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 150, in get_app_config
    raise LookupError("No installed app with label '%s'." % app_label) LookupError: No installed app with label 'mobile_backend/'.

【问题讨论】:

  • 我也有同样的问题,你解决了吗?

标签: python django google-app-engine google-cloud-datastore app-engine-ndb


【解决方案1】:

您的 import 某处似乎有一个杂散的正斜杠 /

确保在所有相关位置导入 mobile_backend 而不是 mobile_backend/

【讨论】:

  • 我的导入中没有任何斜线错误。而且我从不导入 mobile_backend
  • 您的错误的完整堆栈跟踪是什么?请用完整的错误编辑您的问题。
  • @mevius 我刚刚完成了编辑。我也有同样的问题
猜你喜欢
  • 2020-06-13
  • 1970-01-01
  • 2020-06-19
  • 1970-01-01
  • 2019-09-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多