我正在跟随Heroku的Python教程入门,我被困在"Run the app locally" step。我在Windows 7机器上,我已经成功管理了所有以前的步骤。下面的代码是在如上所述的virtualenv中的工具带提供的Git Bash中运行的。错误显示在下面。
ProcFile说(根据说明)
web: python manage.py runserver 0.0.0.0:$PORT
并且命令foreman start web
失败,错误如下所示。
如果我只是在提示符中输入python manage.py runserver 0.0.0.0:5000
,服务器就会启动,我可以访问该应用程序。也许这足以在当地发展,但也许不是,所以如果有人能够了解正在发生的事情,我将不胜感激。谢谢。
(venv)John@JOHN-PC ~/python-getting-started (master)
$ foreman start web
16:06:13 web.1 | started with pid 24536
16:06:13 web.1 | Traceback (most recent call last):
16:06:13 web.1 | File "manage.py", line 10, in <module>
16:06:13 web.1 | execute_from_command_line(sys.argv)
16:06:13 web.1 | File "c:\Users\John\python-getting-started\venv\lib\site-packages\django\core\management\__init__.py", line 399, in execute_from_command_line
16:06:13 web.1 | utility.execute()
16:06:13 web.1 | File "c:\Users\John\python-getting-started\venv\lib\site-packages\django\core\management\__init__.py", line 392, in execute
16:06:13 web.1 | self.fetch_command(subcommand).run_from_argv(self.argv)
16:06:13 web.1 | File "c:\Users\John\python-getting-started\venv\lib\site-packages\django\core\management\base.py", line 242, in run_from_argv
16:06:13 web.1 | self.execute(*args, **options.__dict__)
16:06:13 web.1 | File "c:\Users\John\python-getting-started\venv\lib\site-packages\django\core\management\base.py", line 280, in execute
16:06:13 web.1 | translation.activate('en-us')
16:06:13 web.1 | File "c:\Users\John\python-getting-started\venv\lib\site-packages\django\utils\translation\__init__.py", line 130, in activate
16:06:13 web.1 | return _trans.activate(language)
16:06:13 web.1 | File "c:\Users\John\python-getting-started\venv\lib\site-packages\django\utils\translation\trans_real.py", line 188, in activate
16:06:13 web.1 | _active.value = translation(language)
16:06:13 web.1 | File "c:\Users\John\python-getting-started\venv\lib\site-packages\django\utils\translation\trans_real.py", line 177, in translation
16:06:13 web.1 | default_translation = _fetch(settings.LANGUAGE_CODE)
16:06:13 web.1 | File "c:\Users\John\python-getting-started\venv\lib\site-packages\django\utils\translation\trans_real.py", line 159, in _fetch
16:06:13 web.1 | app = import_module(appname)
16:06:13 web.1 | exited with code 1
16:06:13 system | sending SIGKILL to all processes
16:06:13 | File "c:\Users\John\python-getting-started\venv\lib\site -packages\django\utils\importlib.py", line 40, in import_module