How do I add an SSL certificate to a django nanode?

I have my nanode with django already set up, added a domain name to it, and i would like to know how i could add an SSL certificate (preferrably by Let's Encrypt) to it, so that i can use https instead of http. Any help would be appreciated.

4 Replies

Thank you @stevewi, but the django installation was done through the linode marketplace. Certbot installation instructions require me to know two things: The hosting software, (apache, nginx or other) and the operating system.
All i got to choose while setting up a server with linode was the operating system (for which i chose debian 10), but it never asked me to install any web server application. So I would assume it's not running any except the default django "runserver" command.

Does that mean I can't install certbot on the marketplace version of django? And if it does, does that mean i can't use the marketplace version of django for a "real" django site?
Because at the very least i would expect to be able to run a site that people can actually open, rather than greet them with a "this site is not secure" message.

I wrote up instructions for adding HTTPS to your Django application a few weeks back. I explain how to use Nginx as a reverse proxy to serve your Django app securely.

You can find them here.

Does that mean I can't install certbot on the marketplace version of django?

I don't know squat about django…and even less about the marketplace. However, the answer to your question is "no".

That being said, django is a web framework…not a web server. Underneath your django app is a web server. certbot can still acquire a cert for you without the services of a web server but you have to manually give it the authentication information for your domain, etc that it would normally acquire from a web server.

However, you're ultimately going to need to know the OS and the web server type to deploy the cert…so it would be worth your while to acquire that information. It's probably easier to do that and use it at https://certbot.eff.org than to try to acquire your cert manually (trust me on this).

You already know the OS is Linux. Which distro it is doesn't matter so much. If you want to figure that out, this page:

https://www.linux.com/training-tutorials/how-find-your-linux-version-or-distro-release-and-why-it-matters/

should be able to help you out.

For your determining your web server, see here:

https://www.linode.com/community/questions/19845/how-do-i-see-which-web-server-software-im-running

All of that being said, I would do what @tlambert suggests above. Similarly, I use apache to proxy the private web server* in rspamd (an anti-spam, email authentication system).

-- sw

* Web servers are not hard to build. You can build a pretty functional one with about a dozen lines of perl code. Your home printer and router undoubtedly have embedded web servers in them to make device configuration easy for you. django undoubtedly has one built into it for testing your app…

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct