Ask HN: Django hosting recommendations?
Hey everyone. I've been looking for a webhost that allows me to run a Django app but ALSO has an email server that allows for my employees to have their work email on. The django app will also need the ability to connect to the email server to send account registration emails.
I really like heroku, but they don't have email hosting as an option. Hostgator has email hosting, but doesn't allow django apps.
any recommendations?
thank you
36 comments
[ 4.1 ms ] story [ 62.7 ms ] threadI found Heroku at the time (this was more than two years ago) to be an adequate solution, but it was a little tedious and a little pricey. Nonetheless it had all sorts of easy integrations like Mailchimp and such that my Django application could easily use.
Today, with things like Digital Ocean, I wouldn't re-use Heroku for Django hosting. You also wrote that you'd like to roll your own email server, so I think that would cut out Heroku completely.
I think you'd be most interested in trying out Digital Ocean for a bit. Start with a $5 server and https://www.digitalocean.com/community/tutorials/how-to-use-... see if it works for you or not. $5 isn't much to lose on an experiment and if it works for you, you can spin up one of their other issues
For app hosting, fire and forget (Heroku, Amazon Elastic Beanstalk), shared hosting (like Webfaction and many others), VPS/dedicated server (like AWS EC2, Digital Ocean and many others).
Managed options will take a lot less effort and knowhow to keep a production app running, but cost more. Your own server (VPS) will get you more resources for the same price, but you'll have to configure and maintain everything yourself (app server, static files, database, load balancing, backups and recovery, monitoring, upgrades, security, performance, scaling, etc).
For company email, Office 365, Google G Suite, Rackspace Mail. Maybe Amazon WorkMail (I only know it exists).
Edit: I misunderstood that you're looking for email service. If you want to run your mail server yourself, you need 1) a computer you control (VPS/dedicated) and 2) to know what you're doing. Unless you have a good reason to do that, I suggest you outsource it and get on with your business.
Even if you do have them with the same company you should have them installed on separate VPS. Sounds like OP wants it all on one server, which I would advise against.
No technical reason these two need to be hosted together, and the market has definitely not favored putting all these eggs in one provider.
>No technical reason these two need to be hosted together
Sound advice. To me it sounds like maybe the OP wants both on the same VPS, which is a horrible idea. Even if you found one provider, still you should have separate VPS's for the email and Django app.
[1] https://www.divio.com/en/
Beyond the technical/architectural issues others have brought up, you should not be mixing transactional email with work email for a business. Use a transactional provider like Sendgrid/Mailgun/Mailchimp to manage your registration messages, and run the employee email through something entirely different (a separate server or GApps). It's only a matter of time before someone marks someone's sales email as spam and you end up not being able to send registration emails because Spamhaus has blacklisted your IP.
This might make your solution easier, as you can use an email addon with Heroku for transactional, and then get to choose whatever host you want for employee mail without having to be constrained by needing Django hosting as well.
Can't emphasize that enough.
Django makes it easy to substitute email backends [1], and there are backends available for most transactional ESPs. I maintain one that covers several popular, full-featured ESPs [2]; a quick search of PyPI will also turn up backends for AWS-SES and others.
[1]: https://docs.djangoproject.com/en/1.11/topics/email/#email-b... [2]: https://github.com/anymail/django-anymail
If you still want to host your own email server, perhaps setup a Digital Ocean instance and have the smtp credentials on heroku.
[0] https://github.com/Miserlou/Zappa
AWS EC2 is a great host but requires you to know how to admin the server a bit. Heroku is good for small deployments but the budget options don't scale very well. An AWS competitor like Rackspace or similar might be good too, especially if you're looking for lower prices.
as for email, get a business account (with custom domain) from gmail or something similar. you really don't want to be hosting your own email, not even for a small company. seriously that's a headache you just don't want to deal with if you don't strictly have to (legal compliance requirements, for example). it's not like it costs much to use a hosed solution for email.
the django app needs to connect to the email server? why? isn't the whole point of email that you send messages via SMTP and don't have to have a server-to-server connection? I think you may have some technical requirements you need to pin down with more rigor.
But, also remember, for most transactional email providers you could allow it to send as your employees if that is an important part of your needs. That way you can keep them separate and keep the ability to send email as your employees.
For email I think it's better to use email service like google apps, office 365, zoho mail or fastmail.
For account registration emails, it's better to use transactional email service like sendgrid, mandrill, mailgun, mailjet, or postmark.
SSH access (even on the shared plan) is the killer feature for me. I also really appreciate the simplicity of their approach (domains + applications = websites).
Non-affiliate link: https://www.webfaction.com/
Affiliate link: https://www.webfaction.com/?aid=34899
My co-founder and I ran our startup on Pythonanywhere and used transactional email (although we used Mandrill) with no issues.
[1] https://amazonlightsail.com/ [2] https://aws.amazon.com/ses/ [3] https://aws.amazon.com/workmail/
I get to run any size Django web server I want, and built a custom server for around $2000, and I get to host my own email server as well. I use a Mac Mini server to get the mail server running. Quite easy.