在命令后,在Heroku上部署Django应用程序时出现问题:
heroku run python manage.py migrate
我收到以下错误文本:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python3.7/site-packages/django/core/management/__init__.py", line 308, in execute
settings.INSTALLED_APPS
File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/__init__.py", line 56, in __getattr__
self._setup(name)
File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/__init__.py", line 41, in _setup
self._wrapped = Settings(settings_module)
File "/app/.heroku/python/lib/python3.7/site-packages/django/conf/__init__.py", line 110, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "/app/.heroku/python/lib/python3.7/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 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/app/foodtasker/settings.py", line 145, in <module>
import dj_database_url
ModuleNotFoundError: No module named 'dj_database_url'
当我运行pip freeze
时,似乎已经存在 dj_database_url 。
我的点冻结给出了:
authy==2.2.3
certifi==2018.11.29
chardet==3.0.4
defusedxml==0.5.0
dj-database-url==0.5.0
Django==1.10
django-bootstrap3==7.0.1
django-braces==1.13.0
django-extensions==2.1.4
django-oauth-toolkit==1.0.0
django-oauth2-provider==0.2.6.1
django-rest-framework-social-oauth2==1.0.7
djangorestframework==3.9.0
gunicorn==19.6.0
idna==2.8
oauthlib==2.1.0
phonenumbers==8.10.2
Pillow==3.3.0
psycopg2==2.7.4
PyJWT==1.7.1
python-dotenv==0.10.1
python-social==0.1
python-social-auth==0.3.6
python3-openid==3.1.0
pytz==2018.7
requests==2.21.0
requests-oauthlib==1.0.0
shortuuid==0.5.0
simplejson==3.16.0
six==1.12.0
social-auth-app-django==3.1.0
social-auth-core==2.0.0
urllib3==1.24.1
whitenoise==3.2.1
对于当前状态,我不知道错误的来源。 我很茫然,我希望有人能够为此提供帮助并希望