启动项目失败

来源:7-24 工程中的任务执行锁代码梳理和执行演示

慕移动0419469

2018-02-22

ssh://shark@172.16.153.130:22/home/shark/virtualenv/imoocc_py2.7/bin/python -u /home/shark/MytestProject/imoocc/manage.py runserver 0.0.0.0:8080

Performing system checks...


(0.001) SELECT @@SQL_AUTO_IS_NULL; args=None

(0.000) SELECT VERSION(); args=None

Unhandled exception in thread started by <function wrapper at 0x22e3c08>

Traceback (most recent call last):

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/utils/autoreload.py", line 227, in wrapper

    fn(*args, **kwargs)

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run

    self.check(display_num_errors=True)

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/management/base.py", line 359, in check

    include_deployment_checks=include_deployment_checks,

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/management/base.py", line 346, in _run_checks

    return checks.run_checks(**kwargs)

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/checks/registry.py", line 81, in run_checks

    new_errors = check(app_configs=app_configs)

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/checks/urls.py", line 16, in check_url_config

    return check_resolver(resolver)

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/checks/urls.py", line 26, in check_resolver

    return check_method()

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/urls/resolvers.py", line 254, in check

    for pattern in self.url_patterns:

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__

    res = instance.__dict__[self.name] = self.func(instance)

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/urls/resolvers.py", line 405, in url_patterns

    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/utils/functional.py", line 35, in __get__

    res = instance.__dict__[self.name] = self.func(instance)

  File "/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/urls/resolvers.py", line 398, in urlconf_module

    return import_module(self.urlconf_name)

  File "/usr/lib64/python2.7/importlib/__init__.py", line 30, in import_module

    raise TypeError("relative imports require the 'package' argument")

TypeError: relative imports require the 'package' argument


写回答

1回答

Jeson

2018-02-22

你好,尝试进行迁移,执行:python manage.py migrate 试试

0
0

Python+Django+Ansible Playbook自动化运维项目实战

【课程升级3.6版本】大牛全面践行DevOps,运维与开发间高效协作

861 学习 · 326 问题

查看课程