-
Notifications
You must be signed in to change notification settings - Fork 3
Description
你好~正在學習pecan框架,想利用你的code來做範本練習,請問一下執行指令是pecan serve config.py嗎?執行時有碰到以下錯誤代碼:
Traceback (most recent call last):
File "/home/may/venv/lib/python3.8/site-packages/pecan/configuration.py", line 110, in getattr
return self.values[name]
KeyError: 'server'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/may/venv/bin/pecan", line 11, in
load_entry_point('pecan', 'console_scripts', 'pecan')()
File "/home/may/venv/lib/python3.8/site-packages/pecan/commands/base.py", line 97, in handle_command_line
runner.run(sys.argv[1:])
File "/home/may/venv/lib/python3.8/site-packages/pecan/commands/base.py", line 92, in run
self.commandsns.command_name.run(ns)
File "/home/may/venv/lib/python3.8/site-packages/pecan/commands/serve.py", line 39, in run
self.serve(app, app.config)
File "/home/may/venv/lib/python3.8/site-packages/pecan/commands/serve.py", line 152, in serve
self._serve(app, conf)
File "/home/may/venv/lib/python3.8/site-packages/pecan/commands/serve.py", line 115, in _serve
host, port = conf.server.host, int(conf.server.port)
File "/home/may/venv/lib/python3.8/site-packages/pecan/configuration.py", line 113, in getattr
raise AttributeError(msg)
AttributeError: 'pecan.conf' object has no attribute 'server'