In this exercise we will make a web application from the Gothons game, which we made in exercise 46. To simplify the process of making a web application, we need a we need a web framework. For this exercise we will use lpthw.web, which is the same as the webpy framework.
I installed the web framework thus
pip install lpthw.web
Then I created a project for the web application by creating a directory in my projects directory:
ex50
/bin
app.py
/docs
/gothonweb
__init__.py
/templates
__init__.py
/tests
I just copied the code provided in LPTHW in app.py
I ran the webserver with 'python bin/app.py' and successfully loaded the url http://localhost:8080
However, I realized that lpthw.web was not installed in my virtualenv as I would have expected it to be. It was actually installed in /usr/local/lib/python2.6/dist-packages/ This seems strange and incorrect to me. I am not quite sure what went wrong, so I asked a question on StackOverflow.
The code for this exercise is embedded below:
Hi what is the password of lpthw.web
ReplyDeleteit keeps telling me try again