I learned Python more than 10 years ago, but later chose Rails to be my first web framework to learn, as I also wanted to learn more about Ruby, hence the question.
I learned Python more than 10 years ago, but later chose Rails to be my first web framework to learn, as I also wanted to learn more about Ruby, hence the question.
* I've always preferred Python over Ruby. Explicit imports, namespaces and the "only one way to do something" philosophy have felt more scalable. In general the language does not promote as much implicit magic
* Django reflects the same philosophy: more explicit definitions, a slight bit more configuration and ceremony but easier debuggability.
* The Django docs are, to me, some of the best there is in documenting the framework extensively but also teaching good practices. I've always felt the Ruby docs to be lacking in the latter department so you see more drift in Ruby projects on how to approach the same problems
* Django has felt much stable over the years. Migration between major versions is a breeze.
* The Python library ecosystem is much larger
* The Django admin and Rest Framework are some of the biggest timesavers I've seen. Rails has similar projects but they don't quite make it
Unless you're doing a GIS or project with scientific computing I would not let these factors go above personal preference, as Rails is still an excellent framework.
Lot of the places I see that use Rails now has a separate codebase for their Python work that has to be accessed via separate querying versus just using the Django ORM.
For most cases I would recommend Django to be the main framework for startups. But if you don’t intend to do any ML/AI and only need a defined set of libraries and you are a one man shop then Rails dev speed is so fast.
Django, however, is wonderful for internal tooling, or anything where you need to plug in Python libraries. GIS is a clear win for Django, as well as custom BI work or data analytics
Can you share more here? Would you go the route of django templates for internal tooling?
But, to help those wondering about RnR vs Django for dealing with GIS data, the answer is the python ecosystem is just larger for dealing with GIS data. There are more libraries like fiona, shapely, gdal examples, etc. Django ORM supports all of the PostGIS functions, geos and ogr object helpers.
Rails does not have an alternative for PolygonField, Raster support, or geometry field queries like filter(geom__intersects=area)
Neither Python nor Ruby are my main languages. I used to do a lot of Java and the last eight years I'm using Kotlin mostly. But I've done a lot of freelance and consulting projects as well where I'm happy to use whatever people are using there. I did some pyton and typescript+react recently. I've dabbled with a few Go and Scala projects even. And I'll grudgingly admit to having touched some Php even.
So here's my view:
For me, Django is slightly better than Rails because the people seem to prioritize it just being rock solid, stable, and simple. Python isn't the best, or most elegant at anything it does IMHO. But it's always simple and rock solid and I love it for that. That's what makes it a popular choice for non computer scientists working with data, people in university doing whatever, etc. Ruby was always the more esotheric choice. Lots of people obsessing about meta programming, programming esthetics, and changing their mind about how stuff should be done every 3 months. I found rails to be a bit limited and convoluted. Django and rails do similar things in the end.
The last time I did python, I picked Fastapi and ignored Django. Ruby is fine as a language but it seems to have gone out of fashion a bit. The last time I used it I was using Sinatra, not Rails.
I just prefer light weight frameworks. And I'm a bit opinionated on being able to use the full power of SQL and not having to proxy everything I do through some straight jacket ORM framework that does a lot of magical things in some mediocre way. I can create a table myself and mapping rows to objects isn't rocket science. And I'll write and optimize my queries myself. It's not that hard, and it's not consuming a lot of my time generally. So, the value of optimizing that time is not very high too me. The value of changing and optimizing it when I need to is. And so is the value of just doing it right the first time. And LLMs allow me to generate a lot of the boiler plate stuff (because it is so easy and straighforward). And I'm pretty good at abstracting and encapsulating that. ORMs don't really solve a problem I have.
In the same way server side model view controller (rendering HTML and serving it to the browser on every request) went out of fashion ages ago. Most web and mobile apps use APIs instead. And while server side rendering still is a thing these days, I don't really see a big need for that. It's an optimization. And not one I find I need a lot.
And since server side MVC and ORM are the main point of using Rails or Django, I don't really use either a lot these days.