u/Admirable-Damage213

First of all let me thank you for your replies on my last post, I learned new things (such as gunicorn) and I appreciate your help.

Let me introduce myself again: I'm an experienced PHP developer with 0 experience with Python (I know the basics of the basics but it doesn't count), and after more than 10 years with PHP, I decided to switch to WSGI/ASGI. Why? not because php is bad, actually I really loved it and its syntax, but because of this post by GNU/Linux-libre Hyperbola (ironically, wikidoku is using... php).

So I tried Django and I gave up really quickly because Django felt like attempting to learn something really really complex and I even thought of giving up and choosing RoR (but then I found out that installing rails is a pain, and that rails isn't much different from Django, it's similar, but in Ruby), then I got back to Django, gave up again and then I found Flask.

As a person who never worked with any framework before, Flask seemed, to me, the closest thing possible to "vanilla programming". Unlike Django where you must follow rules and do as they say (and not as you want, because they know better) Flask resembles PHP by that you can simply write few lines and get started easily. In fact, Flask was so simple, that I was mad at myself for not choosing flask from the beginning. I find it even easier than PHP.

Now I found some posts online that tells me to avoid Flask, because Django is more secure. I also kept in mind that some of you don't like apache, but Flask offers connection to mod_wsgi.

Since I truly don't know much about WSGI/ASGI and all of these things, I ask you to help me with the following questions:

  1. Let's start with - What is bad with Apache? why should I not use it?

  2. Why not connecting Flask to Apache with mod_wsgi?

  3. Why and how is Flask less secure than Django, if you can even use Flask-WTF (lol) to take care for all CSRF stuff?

If you got extra time and will I'd highly appreciate to have a useful pros & cons of flask over django, because by far, I prefer flask over django, and I truly don't understand why people prefer django. though flask's documentation is really ugly (looks like it froze in 2010), but I understand it, and that's something that I can't say about django.

My opinion about flask is, that for those who leave PHP and wants something that is as close as possible to PHP, use flask. It's super easy, and if a moron like me understood it, every one can. I loved it, and I'm mad at myself for not knowing flask 10 years ago... I would easily be giving up on all those PHP years if I knew flask back then. (If you're considering to switch from PHP to flask and want help, feel free to talk to me!)

reddit.com
u/Admirable-Damage213 — 15 days ago

Hi everyone

I am an experienced php developer for web stuff and I decided to ditch php for good and to give python a shot for web development.

If you don't know how php works then all you have to do is to install php and apache/nginx and they simply get together and works easily, nearly zero configuration, especially when php and apache works together.

I have never developed anything with python and I do all the code in Debian Trixie (13) / Devuan 6.

I know that in order to install django, I need to use pip. In order to use pip, I need to run it in an isolated environment (venv). In order to get into that venv I need to perform a command that activates that venv, then I can do anything inside it.

But here comes the problem: If I'll try to run that python script outside that venv, using apache, I won't be able to.

How can I use both Django and Apache/Nginx and connect between them?

reddit.com
u/Admirable-Damage213 — 17 days ago