[Django]-How could i use let's encrypt behind a django application without stopping the server?

2đź‘Ť

âś…

I don’t know what setup others use, but I generally set up Django apps with Nginx serving static content and Gunicorn as the application server. It’s widely accepted that Django apps usually use this kind of two web server setup. The standard instructions for setting up Let’s Encrypt with Nginx worked fine for me.

Or Digital Ocean have an excellent guide too.

EDIT: It looks like Nginx can do a “graceful” reload that just updates the config with no downtime. For Debian or Ubuntu pre Systemd this would be sudo service nginx reload, while for a distro with Systemd the command is sudo systemctl reload nginx.service.

👤Matthew Daly

1đź‘Ť

In case other users come this way like I did from Google, here’s how I improved this situation:

I was unsatisfied by my options when it came to creating ACME challenges for Let’s Encrypt when running a Django application. So, I rolled my own solution and created a Django app! Basically, you can manage your ACME challenges as just another object, and the app will produce the proper end-point URL.

Yes you are installing an app which means a deploy / update to your app, but once you’ve done that managing your challenges is far easier in the long run.

Simply pip install django-letsencrypt and follow the README to be on your way.

👤Urda

Leave a comment