ImportError:没有名为“配置文件”的模块

时间:2019-03-26 14:50:07

标签: django python-3.x django-rest-framework

参加在线课程。无法从教师那里得到答复。

我正在使用GIT BASH,并且在runserver命令上收到错误消息。

不确定是否重要,但已安装:

  • GIT(2.21.0)
  • 虚拟盒子(6.0.4)
  • 无业游民(2.2.4)
  • Atom编辑器

我已经使用以下命令安装了django 1.11:

pip install django==1.11

我安装了restframework 3.6.2

pip install djangorestframework==3.6.2

我到达输入的地方:

python manage.py runserver 0.0.0.0:8080

我得到了错误:

没有名为“个人资料”的模块

这是完整的错误:

(profiles_api) vagrant@ubuntu-xenial:/vagrant/src/profiles_project$ python manage.py runserver 0.0.0.0:8080
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f51b1795378>
Traceback (most recent call last):
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/site-packages/django/utils/autoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
    autoreload.raise_last_exception()
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/site-packages/django/utils/autoreload.py", line 250, in raise_last_exception
    six.reraise(*_exception)
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/site-packages/django/utils/autoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/site-packages/django/apps/config.py", line 120, in create
    mod = import_module(mod_path)
  File "/home/vagrant/.virtualenvs/profiles_api/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'profiles'

如果有帮助:这是我的settings.py文件中的 INSTALLED_APPS

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'rest_framework',
    'rest_framework.authtoken',
    'profiles.api',
]

希望我正确地要求它。有什么想法吗?如果需要添加其他内容以使其更清楚,请告诉我。

谢谢

0 个答案:

没有答案