Home > Software engineering >  Django rest framework Heroku Application Error
Django rest framework Heroku Application Error

Time:03-18

-----> Building on the Heroku-20 stack
-----> Using buildpack: heroku/python
-----> Python app detected
-----> Using Python version specified in Pipfile.lock
-----> Requirements file has been changed, clearing cached dependencies
cp: cannot stat '/tmp/build_eaebc38f/requirements.txt': No such file or directory
-----> Installing python-3.10.2
-----> Installing pip 21.3.1, setuptools 57.5.0 and wheel 0.37.0
-----> Installing dependencies with Pipenv 2020.11.15
       Installing dependencies from Pipfile.lock (86a10d)...
       Ignoring tzdata: markers 'sys_platform == "win32"' don't match your environment
-----> Installing SQLite3
-----> $ python manage.py collectstatic --noinput
       System check identified some issues:
       WARNINGS:
       ?: (staticfiles.W004) The directory '/tmp/build_eaebc38f/static' in the STATICFILES_DIRS setting does not exist.
       161 static files copied to '/tmp/build_eaebc38f/staticfiles', 414 post-processed.
-----> Discovering process types
       Procfile declares types -> web
-----> Compressing...
       Done: 98.7M
-----> Launching...
       Released v11
       https://vicsites.herokuapp.com/ deployed to Heroku

This my heroku deployment log and its still showing application error

Here's my Procfile

web: gunicorn vicsite.wsgi --log-file -

The errors I spot in the log stated above are:

?: (staticfiles.W004) The directory '/tmp/build_eaebc38f/static' in the STATICFILES_DIRS setting does not exist. 161 static files copied to '/tmp/build_eaebc38f/staticfiles', 414 post-processed. 'sys_platform == "win32" don't match your environment

My Project Dir


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----         3/11/2022   5:58 AM            .vscode
d----         3/12/2022   9:50 PM            accounts
d----         3/10/2022   6:43 AM            investments
d----         3/13/2022   9:06 PM            site_server
d----         3/14/2022   4:22 AM            static
d----         3/14/2022   4:25 AM            staticfiles
d----         3/10/2022   7:58 PM            transactions
-a---         3/13/2022   2:37 PM         23 .gitignore
-a---         3/13/2022   2:43 PM     303104 db.sqlite3
-a---          3/5/2022   2:55 PM        689 manage.py
-a---         3/14/2022   4:58 AM        345 Pipfile
-a---         3/14/2022   5:45 AM      29742 Pipfile.lock
-a---         3/14/2022  11:10 AM         39 Procfile
-a---          3/5/2022   2:43 PM          9 README.md

CodePudding user response:

The issue was coming from my Procfile. I was passing the folder name (vicsite) instead of the project name(site_server):

web: gunicorn vicsite.wsgi --log-file -

So the correct code to write is:

web: gunicorn site_server.wsgi --log-file -

  • Related