我正在学习本教程: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文档中提到的那样,我得到了以下错误:
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 open或python manage.py runserver
我读到火鸟在窗户上不起作用..。这是真的吗?我找到了这个答案,但不知道如何实现。fcntl substitute on Windows
假设我不能实现fcntl替代品,那么windows的解决方案是什么?如果可能的话,我想使用gunicorn/foreman,因为runserver只是用于开发的。我一直在用heroku,但我不确定这是不是正确的方法。从windows部署/启动服务器的正确方法是什么?还是Linux是唯一的选择?
发布于 2015-04-10 13:09:40
Gunicorn不运行在windows上,因此您需要有一个单独的系统来在本地运行代码。你在运行什么框架?
通常,您可以使用内置的开发服务器(如Django的python manage.py runserver )在本地进行开发,只需在Heroku上使用gunicorn即可。
https://stackoverflow.com/questions/29562199
复制相似问题