首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Django rest框架Heroku应用程序错误

Django rest框架Heroku应用程序错误
EN

Stack Overflow用户
提问于 2022-03-14 05:12:18
回答 1查看 161关注 0票数 0
代码语言:javascript
运行
复制
-----> 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

这是我的heroku部署日志,它仍然显示应用程序错误。

这是我的过程文件

代码语言:javascript
运行
复制
web: gunicorn vicsite.wsgi --log-file -

我在上面提到的日志中发现的错误是:

?:(staticfiles.W004) STATICFILES_DIRS设置中的目录'/tmp/build_eaebc38f/static‘不存在。161个静态文件复制到'/tmp/build_eaebc38f/staticfiles',414个后处理文件。'sys_platform ==‘win32’与您的环境不匹配

我的项目迪尔

代码语言:javascript
运行
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-03-14 21:04:19

这个问题来自我的处理文件。我传递的是文件夹名(vicsite),而不是项目名(Site_server):

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

因此,正确的编写代码是:

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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71463227

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档