6 ms·
A couple of years ago(2014) I made my first Python website and really enjoyed, however when it was time to put it onlin I quickly discovered that setting up hos
by peterpostman 5y ago
A couple of years ago(2014) I made my first Python website and really enjoyed, however when it was time to put it onlin I quickly discovered that setting up hosting and configuring it was as large a task in getting to know pip, env, unicorn, apache2 and a plethora of other software to host it, is this still the case? Becaue this is what keeps me of hosting websites with python.
- airstrike 5y agoYou can always shortcut things by using Docker
- dangerbird2 5y agoYou'll still have to configure gunicorn or another production-ready (w|a)sgi server to serve the app out of the container, but it's much easier to manage dependencies for django in a containerized environment. It's even easier if you use a deterministic package manager like pipenv or poetry instead of old requirements.txt files
- collyw 5y agoAdding an extra layer doesn't make things simpler. It may make it easier to do a second time, but the initial set up is just the same.
- Sileni 5y agoAt least with pip and env, you'd have a hard time doing general tasks in python without getting to know them anyway. You can also shortcut a lot of that with a hosting service like Heroku, which takes on a lot of the mental overhead for you. You've made me curious to ask, what programming environments don't have a significant learning curve when you get to the hosting portion, short of a "no-code" hosting solution?
- chipotle_coyote 5y agoPHP. Deploying small-to-medium PHP projects to production has historically been "move these files to your web root, initialize/seed your database if you have one, and that's it." It's really easy to underestimate how valuable that is in certain contexts, and how much that's contributed to PHP virtually owning the low end of the market. My assumption was always that other languages would find a way to get closer to that model -- never quite to that level for various technical considerations, but close. I'm not sure any really have, save, as you noted, through dedicated hosting services. Fortunately, though, modern PHP frameworks have come to the rescue by becoming far more difficult and fiddly, to the point where both Symfony and Laravel's online tutorials begin with installing Docker.
- hallman76 5y ago> You've made me curious to ask, what programming environments don't have a significant learning curve when you get to the hosting portion, short of a "no-code" hosting solution? With java you can deploy a "fat jar" - a single executable that contains everything it needs, including the web server. You start the jar, it binds to a port, and you're done.
- EmilStenstrom 5y agoI recognize this from some years ago, but it's not an issue any longer, as long as you go to a modern host (ie. Heroku). The old "optimized for PHP"-hosts still make things hard of course...
- number6 5y agoHaving set up some php servers myself: it's not a lot harder to host a python app. It is mostly the that hosters have optimized for php but you could do the same for python
- dempseye 5y ago> A couple of years ago(2014) This is a niggle, but it one that has been niggling at me for the last few days. "A couple" means "two," not "several."
- deleted 5y ago[deleted]
- dempseye 5y agoHilarious. I have been downvoted by illiterates.
- detaro 5y agoMaybe go look in a dictionary before you claim other people are illiterates
- dempseye 5y agohttps://www.dictionary.com/browse/couple https://www.dictionary.com/browse/couple 1. two of the same sort considered together; pair. 2. two persons considered as joined together, as a married or engaged pair, lovers, or dance partners. Are we done here, or do you need another English lesson?
- detaro 5y agoLiterally on https://www.dictionary.com/browse/couple https://www.dictionary.com/browse/couple, the page you linked: > idioms for couple a couple of, more than two, but not many, of; a small number of; a few: It will take a couple of days for the package to get there. A dinner party, whether for a couple of old friends or eight new acquaintances, takes nearly the same amount of effort. And some more dictionaries that agree: https://www.merriam-webster.com/dictionary/couple https://www.merriam-webster.com/dictionary/couple > an indefinite small number: few a couple of days ago https://www.oxfordlearnersdictionaries.com/definition/english/couple_1?q=couple https://www.oxfordlearnersdictionaries.com/definition/englis... > couple (of somebody/something) a small number of people or things: We went there a couple of years ago.*
- illnewsthat 5y agoI had similar issues with Django where I felt that running on localhost was fine, but getting it production ready was a headache. Huge shoutout to dokku[1] which I used on my latest deployment and it makes it super easy. Lets encrypt support was the easiest I've seen and you redeploy with git push. [1] https://dokku.com/docs/getting-started/installation/ https://dokku.com/docs/getting-started/installation/
- dopeboy 5y agoThis was a huge pain for me in the past to the point that I started maintaining a boilerplate to avoid it [0]. But I've heard so many good things about dokku that I think I'll give them a try soon. 0 - https://github.com/dopeboy/django-react-docker-heroku https://github.com/dopeboy/django-react-docker-heroku
- robomartin 5y agoInteresting. How does dokku work with regards to mixed multi-hosting (Apache virtual hosting) on a server? For example, you have five sites, three are PHP and two are Django. Can it deal with that? Also a neat "for free" feature of CPanel hosting is that you get super easy email hosting. This can save a lot of money for small and medium businesses. While some would be interested in using Django on these systems, it is in a range between painful and impossible. This means that you have to now switch to a single-app/domain-per-server scenario (like, Heroku) which is expensive. And then spend more money to host your email elsewhere. Frankly, this has been one of the largest sources of friction for me with Django. I love the framework and would like to use it exclusively but the transition from local development to deployment can be daunting.
- wilsonfiifi 5y agoDokku will allow you to host multiple applications on subdomains for which you can create CNAMEs in your DNS settings. Dokku is more of a mini self hosted Heroku without a dashboard so you'll lose out on cpanel features like email hosting. But If you're not uncomfortable using docker, you can check out Cloudron [0] which handles email [1] and gives you access to quite a few web apps you can easily install on your server. It supports PHP app deployments [2] out of the box but for Django, you'll have to dig a bit deeper into their docs to learn how to deploy a custom docker based app [3]. [0] https://www.cloudron.io/ https://www.cloudron.io/ [1] https://docs.cloudron.io/email/ https://docs.cloudron.io/email/ [2] https://docs.cloudron.io/apps/lamp/ https://docs.cloudron.io/apps/lamp/ [3] https://docs.cloudron.io/custom-apps/tutorial/ https://docs.cloudron.io/custom-apps/tutorial/
- canadapups 5y agoI just migrated to PythonAnywhere.com and it was a breeze. They also have browser access to command line, REPL, Jupyter notebooks too.
- ahmedfromtunis 5y agoI was in a similar position a few years ago too, until I forced myself to learn Docker. Now, all my projects are started from the same building blocks: Docker + Django + Gunicorn + Nginx + Postgres. And I love it. Now I have traefic at the top of My to-learn list so that I can host multiple projects in the same VPS. Last weekend I learned to use 11ty — the first static site generator I managed to grasp — and I'll entend to use that for projects that don't need this level of "complexity".
- williamdclt 5y agoIf you don't want to go the docker route, there's a few Django boilerplates around with an Ansible configuration
- codethief 5y ago> Now I have traefic at the top of My to-learn list so that I can host multiple projects in the same VPS. Traefik is very cool! Just please don't fall into this trap here, like everyone else: https://github.com/traefik/traefik/issues/4174 https://github.com/traefik/traefik/issues/4174
- bjourne 5y ago> Now I have traefic at the top of My to-learn list so that I can host multiple projects in the same VPS. Why do you need that? Nginx dispatches based on the domain name so you can easily host multiple Django sites on the same vps. I use the same tech stack as you except with uwsgi instead of Gunicorn.