Hello,
How can I put my website into maintenance mode to prevent visitors from seeing it? Only administrators should be able to log in.
Thank you
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
Hello,
How can I put my website into maintenance mode to prevent visitors from seeing it? Only administrators should be able to log in.
Thank you
If you're using Odoo.sh or Odoo Online (Enterprise) :
This automatically displays a maintenance message to public users.
from odoo import http
from odoo.http import request
class WebsiteMaintenance(http.Controller):
    @http.route('/', auth='public', website=True)
    def homepage(self, **kw):
        if not request.session.uid: # If user is not logged in
            return request.render('your_module_name.maintenance_page')
        return request.redirect('/web') # Let admins access backend
    @http.route('/<path:path>', auth='public', website=True)
    def catch_all(self, path, **kwargs):
        if not request.session.uid:
            return request.render('your_module_name.maintenance_page')
        return request.redirect('/web')
<template id="maintenance_page" name="Maintenance Page">
    <t t-call="website.layout">
        <div class="container">
            <h1>We'll be back soon!</h1>
            <p>The website is currently under maintenance. Please check back later.</p>
        </div>
    </t>
</template>
If you're self-hosting, you can enable a maintenance.html page via your web server config (Nginx or Apache).
Thanks & Regards,
Email: contact@datainteger.com
Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!
Zarejestruj się| Powiązane posty | Odpowiedzi | Widoki | Czynność | |
|---|---|---|---|---|
|  | 0 sie 24  | 1454 | ||
|  | 0 lut 24  | 1460 | ||
| 
            
                Tracking Maintenance Request
            
            
                    Rozwiązane
            
         |  | 2 wrz 25  | 2130 | |
|  | 0 wrz 24  | 1214 | ||
|  | 0 lut 24  | 1359 |