Django shop错误:“没有名为shop的模块”

2024-05-19 18:48:35 发布

您现在位置:Python中文网/ 问答频道 /正文

当我启动一个django商店时,我收到一条错误消息:ImportError: No module named shop。在

  1. 我已经转到我的项目总监
  2. 激活virtualenv
  3. 安装django-shop,使用pip install django-shop
  4. 将模块shop添加到我的项目目录中的settings.py
  5. 在myurls.py中添加了一个字符串(r'^shop/', include('shop.urls')),

所有的工作都没有出错。有什么建议可以解决这个问题吗?在

已安装应用程序列表来自设置.py公司名称:

'INSTALLED_APPS = (
'djangocms_admin_style',
'djangocms_text_ckeditor',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai',
'treebeard',
'djangocms_style',
'djangocms_column',
'djangocms_file',
'djangocms_flash',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_link',
'djangocms_picture',
'djangocms_teaser',
'djangocms_video',
'reversion',
'shop',
'shop.addressmodel',
'eshop',

)'

以下是pip freeze --local结果:

^{pr2}$

从终端回溯:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/stp/web/eshop/env/local/lib/python2.7/site-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named shop

Tags: djangoinpywebhomeliblocalline