Newbie django 'deployment' question

I have a bluehost account that I've had for maybe 3 years to own a domain name with (smartter.org is my domain), and it's a lameass PHP web server or something, I used it for learning bootstrap/jquery and sometimes I host static files on it, etc. Setting up a domain name is one thing about the compute power companies (like aws) that is much more difficult.

My solution is to use digital ocean (aws works just as well, I prefer DO because I can spin up new instances in seconds, amazon has multiple pages of forms to fill out, including AWS specific stuff like amazon security groups, a security control specific to amazon which are prerequisite to deploying on aws -- easier to fuck up your own security.), and when I need a DNS record pointing at a digital ocean instance I can do one of a couple things:

  • Simplest but only works locally is to modify your /etc/hosts file. This is nice when you're demoing something and don't want to expose the address / domain name to the audience. here's a quick tutorial. I also use hosts file to assign names to all my different digital ocean nodes so instead of ssh [email protected] I can put a line in my hosts file: 43.192.182.243 thunderhorn run django on port 8000 and access it at ssh root@thunderhorn

  • Free Dynamic DNS providers allow you to control a single subdomain on a domain with thousands of subdomains. These are often used by malware distributors and whatnot, so be warned you're going to look shady. My favorite is https://zzzz.io because it seems to be used mostly by legitimate people. no-ip.org on the other hand was recently taken down by Microsoft for hosting malicious windows updates.

  • Use bluehost cPanel to modify the DNS records bluehost maintains on my behalf as part of my hosting plan. I simply put the IP of my digital ocean instance into the bluehost interface, tell it to create a CNAME record to smartter.org and bam, I've got a custom django server running under my actual domain name, which has a wildcard HTTPS / ssl cert that automatically will work for the app. I was surprised how easy this was to do, just took some knowledge about dns and the capabilities of Bluehost. Bluehost Support helped me my first time through.

Hope it helps!

/r/django Thread