Odoo also provides a web development framework, which can be used to develop website features closely integrated with our backend apps. We will take our first steps toward this by creating a simple web page to display the list of active books in our library. It will respond to web requests at the http://my-server/library/books
address, so /library/books
is the URL endpoint we want to implement.
We will just have a short taste of what web development with Odoo looks like. This topic is addressed in more depth in Chapter 13, Creating Website Frontend Features.
Web controllers are the components responsible for rendering web pages. Controllers are methods defined in an http.Controller
class, and they are bound to URL endpoints. When that URL endpoint is accessed, the controller code executes, producing the HTML to be presented to the user. To help with rendering the HTML, we have the QWeb templating engine.
The convention is to place the code for controllers inside...