can update templates without restart gunicorn?

Hi
I did deploy Django based on this guide:

The main issue, now i need to restart gunicorn to reflect any update in app templates.
Is there a way to update templates without restart Django server (gunicorn or other server)?

other thing, if i restart the Django server (takes a few seconds) is that can effect the visitors or the #SEO rating, by showing error pages like 500 or 404 etc ?

Not out of the box… :thinking:

You’ll be using the cached template loader, which is important for performance.

You could try calling the internal django.template.autoreload.reset_loaders() — which is what happens in development — but that’s not officially supported API, so take that as you will.

1 Like

Side note: If you’re running gunicorn behind nginx, you can configure nginx to handle the 502 error (or any other error for that matter), with a custom page - or even a reference to a different application. (See Configuring NGINX and NGINX Plus as a Web Server | NGINX Documentation for some ideas along those lines along with the details at Module ngx_http_core_module)

1 Like