**** File HelloServer.cfg **** [server] socketPort=80 [staticContent] static=/home/remi/static # Here I add my own configuration options [user] name=Remi [database] login=remiLogin password=remiPassword *** File Hello.cpy **** CherryClass Root: view: def index(self): <html><body> Hello, <py-eval="configFile.get('user','name')"><br> to connect to the database, you should use:<br> <py-eval="'Login:%s, Password:%s'%(configFile.get('database','login'), configFile.get('database','password'))"> </body></html>
<html><body> Hello, Remi<br> to connect to the database, you should use:<br> Login:remiLogin, Password:remiPassword </body></html>
In the next chapter, we'll learn about CherryPy's special variables and special functions ...
See About this document... for information on suggesting changes.