20 comments

[ 5.2 ms ] story [ 67.0 ms ] thread
I'm glad that the first section of this points to the official Django project documentation [1], which is one of the best project documentations I've ever seen.

I programmed in Python for scientific computing for a dozen years before picking up Django for my first web app. What an absolute joy it's been.

[1] https://docs.djangoproject.com/

I used Python for basically sys admin tasks and data transformation for 10+ years and then had the same joy when I found Django. It truly makes web development fun and you can make a decent site in a very reasonable amount of time.
As someone who only knows frontend / React, I’ve been curious about Django vs Rails vs Laravel literally for years.

One day I intend to take one of these for an extended spin and see how it contrasts with gluing things together in JavaScript land.

Opinions on this vary wildly, but you can be very productive with any of them. Pick what makes the most sense to you and get to it!
A few reasons I like Django in general [Have also used Laravel]:

- Out of the box db modeling + true relational schema generation, migrations & rollbacks. Get going with local sqlite right away.

- You can always check what db migrations are going to do by generating the raw SQL for a migration file. [1]

- It has a separate, secure web admin for data management, user management, + whatever [2].

- Combine with e.g. Django REST Framework [3] for REST API functionality.

- Can run it on AWS Lambda with zappa.(<sigh> "serverless")

1 - https://docs.djangoproject.com/en/4.0/ref/models/relations/

2 - https://docs.djangoproject.com/en/4.0/intro/tutorial07/

3 - https://www.django-rest-framework.org/

4 - https://blog.logrocket.com/zappa-and-aws-lambda-for-serverle...

edit: format

I would say go for Elixir. It’s the right choice for building backend services.
All great options. Really boils down to which language will give you the most mileage for what you’re trying to achieve as a developer - Python, Ruby or PHP. Better yet if you have the time, give them all a spin and let the philosophies that influence each frameworks design drive your decision.
Nodejs and surrounding ecosystem is good for extreme performance apps, built with very little hardware expense. I would say very few people have this requirement.

Django is absolutely fast enough and it’s pure Python. The benefits are easy and fast development, as well as ability to plug-in a billion of available Python modules, including all of the available AI infrastructure.

can we stop using python for web sites in 2022
Oh boy! Here we go...

And why's that then?

As opposed to what ? hacked together JavaScript ?

Always use the right tool for the job.

* If you want absolute performance ? - Rust, C, C++

* Mix of performance and ease of development - Go, Java, C#

* Easy development - Python, Ruby, PHP, JS.

And a shitton of other languages in between.

Depends on the "we".

I will not stop. About three years ago, I put together a small site using Django, at my wife's request. Rewriting it is not a priority.

What should we use then? C?
Python really sucks for large projects. Also, I hate the GIL
What makes it so bad for large projects?
Lack of an interface mechanism, with multi inheritance instead, is messy. This is my biggest complaint that doesn't apply to pretty much all dynamic languages.
Learn FastAPI instead (for new projects where you don't want the template-based MVC). Django is showing its age and comes with some unpalatable design decisions, particularly in its active record ORM. Django's most useful feature is arguably automated DB migrations, but this can also be achieved with SQLAlchemy+Alembic
I've dabbled with FastAPI a few times when starting new projects, but the lack of a high-quality ORM always had me switch right back to Django after a few hours. Sure, you can use SQLAlchemy, but it's a miserable experience compared to the Django ORM + admin interface.

Sure, Django is mostly designed around server-side rendering of full pages, but with DRF you can build REST APIs perfectly fine, and there's also http://django-ninja.rest-framework.com/ which I think is more or less similar to FastAPI in the way you write code with it.