CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hi any body explain this @http.route usage in below code
@http.route('/hello/world', auth='public')('/hello/world', auth='public')
return "Hello World"
It is called web controller. Decorator marking the decorated method as being a handler for requests. The method must be part of a subclass of Controller.
If you enter localhost:8070/web/hello/world, it will print "Hello world" in your browser. This is responsible to decide which page is shown in which url. The parament auth is for authentication purpose. Is this page is shown for all or only logged in user only can view it. For more...
The type of authentication method, can be one of the following:
- user: The user must be authenticated and the current request will perform using the rights of the user.
- admin: The user may not be authenticated and the current request will perform using the admin user.
- none: The method is always active, even if there is no database. Mainly used by the framework and authentication modules. There request code will not have any facilities to access the database nor have any configuration indicating the current database nor the current user.
- public: public authentication, not login required.
About This Community
Odoo Training Center
|Asked: 2/10/15, 2:49 AM|
|Seen: 1597 times|
|Last updated: 3/16/15, 8:10 AM|