为了账号安全,请及时绑定邮箱和手机立即绑定

各位大神谁能告诉我这是什么错误

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

Traceback (most recent call last):

  File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper

    fn(*args, **kwargs)

  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 121, in inner_run

    self.check(display_num_errors=True)

  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 374, in check

    include_deployment_checks=include_deployment_checks,

  File "C:\Python27\lib\site-packages\django\core\management\base.py", line 361, in _run_checks

    return checks.run_checks(**kwargs)

  File "C:\Python27\lib\site-packages\django\core\checks\registry.py", line 81, in run_checks

    new_errors = check(app_configs=app_configs)

  File "C:\Python27\lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config

    return check_resolver(resolver)

  File "C:\Python27\lib\site-packages\django\core\checks\urls.py", line 24, in check_resolver

    for pattern in resolver.url_patterns:

  File "C:\Python27\lib\site-packages\django\utils\functional.py", line 35, in __get__

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

  File "C:\Python27\lib\site-packages\django\urls\resolvers.py", line 313, in url_patterns

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

  File "C:\Python27\lib\site-packages\django\utils\functional.py", line 35, in __get__

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

  File "C:\Python27\lib\site-packages\django\urls\resolvers.py", line 306, in urlconf_module

    return import_module(self.urlconf_name)

  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module

    __import__(name)

  File "D:\Varsha\python\myapp\myapp\urls.py", line 21, in <module>

    url(r'^app/',include('app.urls')),

  File "C:\Python27\lib\site-packages\django\conf\urls\__init__.py", line 50, in include

    urlconf_module = import_module(urlconf_module)

  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module

    __import__(name)

  File "D:\Varsha\python\myapp\app\urls.py", line 3, in <module>

    from . import views

  File "D:\Varsha\python\myapp\app\views.py", line 7

    article = models.Article.objects.get(pk=1)

          ^

IndentationError: expected an indented block


正在回答

1 回答

  File "D:\Varsha\python\myapp\app\views.py", line 7

    article = models.Article.objects.get(pk=1)

          ^

IndentationError: expected an indented block


看错误提示,此处只需要缩进。检查下“article”这里格式对不对


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
django入门与实践
  • 参与学习       65159    人
  • 解答问题       869    个

手把手带你进入Django开发的大门,充分领略Django的魅力

进入课程

各位大神谁能告诉我这是什么错误

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信