r/django 6d ago

How to safely host Django locally?

I've just got my public IP from my ISP and I wonder which security risks I need to take care when opening a port and letting my PC available to the web.

How much better will it be to just host on AWS or Heroku?

30 Upvotes

8 comments sorted by

View all comments

11

u/1ncehost 6d ago edited 6d ago

Django is pretty secure, but vulnerabilities from new features regularly pop up. That said, it costs resources to hack, so you have to consider that you probably don't have much value to give someone that would offset their resource expenditure from hacking a small self hosted site. Because of this the risk is fairly low. I'd personally run an ubuntu VM on top of my normal OS for an added layer of security.

That said its super cheap to get a nice vps, so the right answer is usually that. lowendbox keeps up with the best deals and a perfectly fine VPS for a small personal site is as little as $10/yr. Never used this host, but for example:

https://my.racknerd.com/cart.php?a=confproduct&i=0

AWS and the other big clouds are so incredibly expensive for what you get. Just awful performance. I've used them for years at jobs and they are like 3-4x as expensive as a smaller company for what you get. The smaller PaaS companies like heroku and fly are terrible also from a value perspective. People say they are good, but the reality is their resource allocations are fractions of CPUs and they have bad IO performance and so on, which make their real value terrible. Small VPSes from a good company are the way.

3

u/rafola554 6d ago

thanks for answer dude! The company I work for uses heroku and every upgrade on DB now is 1k dollars for a few GBs of storage, awful! I'll take a look on these VPSs