この問題を検索しましたが、この問題を参照する特定の解決策はありません。Python-pyramidはローカルホストを実行しません
python pyramidをインストールして実行しようとしています。
私はanaconda
をインストールし、仮想環境を作成し、pip install "pyramid==1.7.3"
を使用してピラミッドをインストールしました。
はその後
`from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
def hello_world(request):
return Response('Hello %(name)s!' % request.matchdict)
if __name__ == '__main__':
config = Configurator()
config.add_route('hello', '/hello/{name}')
config.add_view(hello_world, route_name='hello')
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 8080, app)
server.serve_forever()`
このhelloworld.py
を実行します。これはサーバーを起動しないので、ブラウザでlocalhost:8080
を開くと、404 Not Found The resource could not be found.
エラーが表示されます。ここ
は、私がここで何をしないのですCommand Prompt
のですか?
誰かが気付かなかった場合は、私は初心者です。
は、あなたのサーバが起動しなかったし、実行されています。 "localhost:8080/hello/john"を使用してみてください –
それは "http:// localhost:8080/hello/world" – user6923096