DjangoWeb开发遇到的第一个坑

项目场景:

新建了第一个Django项目


问题描述:

执行 python manage.py runserver的时候疯狂报错


```python
E:\tool\django_test\test_noe>python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
October 30, 2020 - 14:45:19
Django version 3.1.1, using settings 'test_noe.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
E:\tool\django_test\test_noe\test_noe\settings.py changed, reloading.
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "D:\py3.7\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "D:\py3.7\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\utils\autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\core\management\commands\runserver.py", line 110, in inner_run
    autoreload.raise_last_exception()
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\utils\autoreload.py", line 76, in raise_last_exception
    raise _exception[1]
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\core\management\__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\utils\autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\apps\registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\apps\config.py", line 90, in create
    module = import_module(entry)
  File "D:\py3.7\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'rest-framework'

Traceback (most recent call last):
  File "manage.py", line 22, in <module>
    main()
  File "manage.py", line 18, in main
    execute_from_command_line(sys.argv)
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\core\management\__init__.py", line 401, in execute_from_command
_line
    utility.execute()
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\core\management\__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "D:\py3.7\lib\site-packages\django-3.1.1-py3.7.egg\django\core\management\base.py", line 330, in run_from_argv
    self.execute(*args, *
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值