尝试将我的第一个python项目部署到heroku,遇到此错误-ModuleNotFoundError:没有名为“ net_positive”的模块 非常困惑,花了一整天的时间搜索这个问题
Procfile
web: gunicorn net_positive.wsgi.py --log-file -
目录结构
net_positve_dir
-net_positive
-- _pycache__
__init__.py
-- asgi.py
-- settings.py
-- urls.py
-- wsgi.py
乒乓球 db.sqlite3 manage.py 规格 意见 requirements.txt
据我所知,gunicorn会根据我告诉它在procfile中的去向加载文件,不确定为什么我目前在heroku上没有运行(崩溃)
"""
WSGI config for net_positive project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
print '===== sys.path / PYTHONPATH ====='
for k in sorted(os.environ.keys()):
v = os.environ[k]
print ('%-30s %s' % (k,v[:70]))
print os.environ['VIRTUAL_ENV']
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'net_positive.settings')
application = get_wsgi_application()