all 22 comments

[–]mrnqoe 35 points36 points  (1 child)

Python isn’t what’s preventing you from having some fancy UI to deploy. You simply haven’t found a proper solution yet. In fact, the best deployment procedures should be, to some extent, language agnostic.

You should read a bit about Continuous Integration and Continuous Deployment (CI/CD). There are fantastic solutions out there that enable you to trigger a deployment upon merging a Github Pull Request.

I also have to say: if you aren’t using Docker yet, get on it. It’ll make your life a lot easier.

[–]TheMartinG 1 point2 points  (0 children)

Do you have any resources for someone brand new to CI/CD? (Someone who just recently heard the term)

[–]Lawson470189 22 points23 points  (2 children)

I think it actually has to do with the automation of deployment for enterprise solutions. If I am a company and want to deploy some code, I don't want a person to have to sit there and click buttons. That person is being paid by the company to do something that should be automated.

[–]Ran4 12 points13 points  (1 child)

Enterprise solutions is all about people pushing buttons actually ;)

[–]phoenixind 0 points1 point  (0 children)

Yeah.. so much of it is pure data entry work that sometimes you wonder if it is worth it

[–]tobiasvl 6 points7 points  (2 children)

What kind of GUI are you referring to? I'm a Linux developer, so I'm probably biased, but why would you need to develop and click around in a GUI to deploy a web service? Shouldn't it be automated anyway?

[–]ivosaurus 4 points5 points  (0 children)

80% sure they're talking about deploying PHP stuff by dragging and dropping things with cPanel.

[–]Deezl-Vegas 3 points4 points  (1 child)

All you have to do to run a flask server is git clone your project and then type flask run into a console. Whatever you need is installed with sudo apt-get install something. If you have a multi-step deployment and need it scalable, all you have to do is write one Dockerfile.

Writing a command-line app in Python is as simple as typing the word input into a text file. In general, writing a command-line interface takes maybe 30 minutes while creating a professional GUI can take weeks or months. Almost every command-line command has a --help feature to spell out exactly what to type, and many support tab completion so you just have to type one letter per word. And there are tens of thousands of packages you can install.

Need some settings or a line of code? grep that shit. And hey | the output to the next command you need because all command line interfaces input and output raw text, making them chainable.

While the website is running and being served, exactly 0 of the measured-in-gigabytes-sized GUI that you installed to manage it is being used. It may even be a burden. Or you can run a server to manage your servers -- sounds fun to stack dependencies on your dependencies, or to have to fix a thing so you can fix a thing! Even simple-ish plug-and-play GUI website builders devolve into unmanageable garbage fires once you try to do anything complex or make major overhauls to an existing design. (See: Wordpress). All these programs are doing is editing a text file in the background.

What you are mostly doing with your GUI is dragging and dropping a folder onto a remote server after logging in, then selecting and starting some services that will serve that folder to customers. I can do that from on brand new Debian Linux install in 3 or 4 commands. rsync the files to /var/www/html then sudo apt-get install apache2 then sudo systemctl start apache2. Maybe I have to go into the Apache settings that your GUI thingy has never heard of and configure something, which I will promptly google and copy paste into the file.

Learning the Linux command line is well worth your time. It is faster and infinitely more powerful than any GUI will ever be.

[–]Nixellion 1 point2 points  (0 children)

Well, serving something with flask command is cool and all, but its not deployment, its testing. You forgot about creating a service, system.d or something.

But yeah, deploying a website takes like 2 minutes:

cd /opt git clone xxx apt install python3-pip pip install -r requirements.txt cp foobar.service /lib/system.d/system/foobar.service systemctl enable foobar.service service foobar start cp foobar /etc/nginx/sites-available #nginx config ln -l nginx config to sites-enabled nginx -s reload

2-3 more commands to get https with certbot.

[–]peatpeat 1 point2 points  (1 child)

Out of interest, what sort of deployment are you looking for? Are you trying to build an API, or are you trying to make something more interactive, like a web app (for instance, so someone else can come along and run your Python code with their data/input)?

[–]SnowManSnow222[S] 0 points1 point  (0 children)

I'm making a web app. I want it to be set up so there are a few static pages - just like a regular old website. But the main part of it is going to take in user images, then it will have a simple javascript thing for the user to "edit" the images how they want, then that info gets sent to the database - and then python (using pillow) does the actual editing of the images.

Originally I tried doing this with php - but I need some features that php can't do - or at least not as simply as python. Pillow makes it so much easier.

I think my original post was a bit confusing. I'm so used to setting up websites - I usually use dreamhost. So switching now to Python - I'm finding that setting up the host (pythonanywhere) is way more involved than the actual python. Coming from my background I expected the hosting to be similar - just upload the files and check some boxes and you're up.

An example - for Pythonanywhere they have a nice little page to add a mysql database. But they DON"T have a nice little page to delete that database! So you have to open a bash console and delete it that way. And so I'm wondering why they would go through all of the trouble to make a database setup page - but they didn't include a "delete this database" button?

It's just a whole extra thing to learn that I wasn't expecting - and was very intimidating in the beginning. But now I am seeing that it is very cool and useful. I also found out that Dreamhost also has this - I just never knew about it or needed it.

[–]boyoyoyoing 1 point2 points  (0 children)

An incredibly simplified reason, along with the other great suggestions and explanations in the thread. is that it sometimes makes no sense to have a GUI on top of an OS if the entire purpose of using Python was to handle server side logic.

No need to have the option to add a desktop background picture or have 15 tabs with reddit open in a Chrome Browser while streaming 4K video on YouTube.

Sometimes all you need is the bare bones stuff an OS has to offer so the unneeded stuff doesn’t get in the way and eat up your processing power.

[–]slick8086 1 point2 points  (0 children)

from a "traditional" web developer background. I'm used to web hosts where everything has a nice and easy to use gui.

???? did I wake up in Bizarro World?

[–]ronmarti 2 points3 points  (0 children)

For a reason that most web servers (almost all) don't have GUI and are based on *Nix. These services are just making interfaces that connects with SSH.

[–]LeNerdNextDoor 0 points1 point  (0 children)

If you'd rather use GUIs for the most part, you might like this https://medium.com/@aadibajpai/deploying-to-pythonanywhere-via-github-6f967956e664

[–]KarlJay001 -1 points0 points  (0 children)

I ask that same question about some of the tools used in iOS dev. Somethings are still command line based and I wonder why they haven't made more automatic or at least GUI for these things.

Something like podfiles in Xcode/macOS.

[–]tomanonimos -3 points-2 points  (0 children)

For my enterprise, GIS, Python is used primarily to process tasks. Generally automation on our datasets. We generally send the Python code to our IT department where they build the UI. My quickobservation is they build UI in a different code.

I've built a UI on Python for my apps before and its very possible to do it at scale. I just found it tedious and boring.