首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Heroku,Django,Foreman

Heroku,Django,Foreman
EN

Stack Overflow用户
提问于 2015-04-10 13:03:57
回答 1查看 1.8K关注 0票数 4

我正在学习本教程:http://tutorial.djangogirls.org/en/domain/README.html

但是,当我运行foreman start web时,正如https://devcenter.heroku.com/articles/getting-started-with-python#run-the-app-locally的heroku文档中提到的那样,我得到了以下错误:

代码语言:javascript
复制
03:43:05 web.1  | started with pid 47516
03:43:05 web.1  | Traceback (most recent call last):
03:43:05 web.1  |   File "C:\Python34\lib\runpy.py", line 170, in _run_module_as_main
03:43:05 web.1  |     "__main__", mod_spec)
03:43:05 web.1  |   File "C:\Python34\lib\runpy.py", line 85, in _run_code
03:43:05 web.1  |     exec(code, run_globals)
03:43:05 web.1  |   File "c:\Users\shenk\Documents\Programming\django_projects\djangogirls\myvenv\Scripts\gunicorn.exe\_
_main__.py", line 5, in <module>
03:43:05 web.1  |   File "c:\Users\shenk\Documents\Programming\django_projects\djangogirls\myvenv\lib\site-packages\guni
corn\app\wsgiapp.py", line 10, in <module>
03:43:05 web.1  |     from gunicorn.app.base import Application
03:43:05 web.1  |   File "c:\Users\shenk\Documents\Programming\django_projects\djangogirls\myvenv\lib\site-packages\guni
corn\app\base.py", line 12, in <module>
03:43:05 web.1  |     from gunicorn import util
03:43:05 web.1  |   File "c:\Users\shenk\Documents\Programming\django_projects\djangogirls\myvenv\lib\site-packages\guni
corn\util.py", line 9, in <module>
03:43:05 web.1  |     import fcntl
03:43:05 web.1  | ImportError: No module named 'fcntl'
03:43:05 web.1  | exited with code 1
03:43:05 system | sending SIGKILL to all processes

我应该用工头吗?我读过那本我应该用的歌,但我不知道该怎么用。我找不到任何示例说明如何使用gunicorn来启动服务器,而不是使用heroku openpython manage.py runserver

我读到火鸟在窗户上不起作用..。这是真的吗?我找到了这个答案,但不知道如何实现。fcntl substitute on Windows

假设我不能实现fcntl替代品,那么windows的解决方案是什么?如果可能的话,我想使用gunicorn/foreman,因为runserver只是用于开发的。我一直在用heroku,但我不确定这是不是正确的方法。从windows部署/启动服务器的正确方法是什么?还是Linux是唯一的选择?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-04-10 13:09:40

Gunicorn不运行在windows上,因此您需要有一个单独的系统来在本地运行代码。你在运行什么框架?

通常,您可以使用内置的开发服务器(如Django的python manage.py runserver )在本地进行开发,只需在Heroku上使用gunicorn即可。

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

https://stackoverflow.com/questions/29562199

复制
相关文章

相似问题

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