Hi Campers! I’ve been building my portfolio web page with Django. It wasn’t that complicated and I made it simple. However the real part started once I wanted to deploy my web with Heroku which I already used for deploying my node.js webs.
I can run with “heroku local” and it runs fine also when I use runserver in virtualenv but there’s same errors and I’ve searched for the solutions whole day but I couldn’t.
2021-02-16T20:26:35.823862+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2021-02-16T20:26:35.823862+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2021-02-16T20:26:35.823863+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
2021-02-16T20:26:35.823863+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2021-02-16T20:26:35.823863+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2021-02-16T20:26:35.823864+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2021-02-16T20:26:35.823864+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
2021-02-16T20:26:35.823864+00:00 app[web.1]: ModuleNotFoundError: No module named 'portfolio'
2021-02-16T20:26:35.824001+00:00 app[web.1]: [2021-02-16 20:26:35 +0000] [8] [INFO] Worker exiting (pid: 8)
2021-02-16T20:26:35.856818+00:00 app[web.1]: [2021-02-16 20:26:35 +0000] [4] [INFO] Shutting down: Master
2021-02-16T20:26:35.856905+00:00 app[web.1]: [2021-02-16 20:26:35 +0000] [4] [INFO] Reason: Worker failed to boot.
2021-02-16T20:26:35.918015+00:00 heroku[web.1]: Process exited with status 3
2021-02-16T20:26:35.980096+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-16T20:26:36.601488+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=poianakim.herokuapp.com request_id=93a834d5-7212-499d-9f98-f02936bc7459 fwd="95.239.217.192" dyno= connect= service= status=503 bytes= protocol=https
2021-02-16T20:26:37.057729+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=poianakim.herokuapp.com request_id=34840aae-ab2d-49d5-8143-df2f0d30d8bf fwd="95.239.217.192" dyno= connect= service= status=503 bytes= protocol=https
2021-02-16T20:26:37.548866+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=poianakim.herokuapp.com request_id=5055a2e6-cd2f-4b3d-8886-2eac26b19075 fwd="95.239.217.192" dyno= connect= service= status=503 bytes= protocol=https
I think significant line would be
ModuleNotFoundError: No module named 'portfolio'
portfolio is my project name and there are several apps
This is my file tree and I managed to put requirements.txt and runtime.txt beside to venv directory since that is the root of git repo. and I had to move Procfile into the venv since the former structure caused error.
psycopg2-binary==2.8.6
asgiref==3.3.1
dj-database-url==0.5.0
Django==3.1.6
gunicorn==20.0.4
numpy==1.20.1
pandas==1.2.2
Pillow==8.1.0
python-dateutil==2.8.1
python-dotenv==0.15.0
pytz==2021.1
six==1.15.0
sqlparse==0.4.1
whitenoise==5.2.0
requests==2.25.1
This is my requirements. txt
and gitignore file with
env
# Text backup files
*.bak
#Database
*.sqlite3
python version is 3.8.5 and it’s supported by heroku
It’s been deployed and built but the Application error makes me crazy
I really wish there’s someone who can help me!!