J'ai cherché ce problème, il n'y a pas de solution à ce problème. J'essaie d'installer et d'exécuter la pyramide python. J'ai installé anaconda
, créé un environnement virtuel et utilisé pip install "pyramid==1.7.3"
pour installer la pyramide.Python-pyramide ne fonctionne pas hôte local
ensuite exécuté
`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()`
ce helloworld.py
. Cela ne démarre pas le serveur et quand j'ouvre le localhost:8080
dans le navigateur, il m'a donné une erreur 404 Not Found The resource could not be found.
.
ici est le Command Prompt
Qu'est-ce que je manque ici? Au cas où quelqu'un ne s'en apercevrait pas, je suis un novice.
Votre serveur ne démarre et est en cours d'exécution. Essayez d'utiliser "localhost: 8080/hello/john" –
Oui, il sert à "http: // localhost: 8080/hello/world" – user6923096