尝试部署到Heroku时,我收到以下错误:
22:06:03 web.1 | apps.populate(settings.INSTALLED_APPS)
22:06:03 web.1 | File "/Users/XXX/.envs/carla/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
22:06:03 web.1 | app_config = AppConfig.create(entry)
22:06:03 web.1 | File "/Users/XXX/.envs/carla/lib/python3.5/site-packages/django/apps/config.py", line 94, in create
22:06:03 web.1 | module = import_module(entry)
22:06:03 web.1 | File "/Users/XXX/.envs/carla/lib/python3.5/importlib/__init__.py", line 126, in import_module
22:06:03 web.1 | return _bootstrap._gcd_import(name[level:], package, level)
22:06:03 web.1 | ImportError: No module named 'accounts'
已安装的应用
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.humanize',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_summernote',
'widget_tweaks',
'accounts',
...
]
项目结构:
- carla/
- carla/
- accounts/
- static/
- templates/
- config
- settings/
- __init__.py
- urls.py
- wsgi.py
- manage.py
- Procfile
- requirements.txt
...
有谁知道为什么Heroku无法找到我的'accounts'
应用?它在本地工作正常,显然在我的INSTALLED_APPS
。
提前谢谢!
答案 0 :(得分:1)
看起来您的项目层次结构错误,不确定如何使其在本地工作。你有两个carla折叠应该只有一个carla,第二个应该用帐户替换,否则在settings.py文件中你应该在installed_apps中放入carla.accounts而不是account。