Need advice about which tool to choose?Ask the StackShare community!

Django

36.8K
33.3K
+ 1
4.2K
Rails

19.2K
13.4K
+ 1
5.4K
Add tool

Django vs Rails: What are the differences?

# Introduction

1. **Language**: Django is written in Python, while Rails is written in Ruby.
2. **Database Support**: Django comes with built-in support for multiple databases like PostgreSQL, MySQL, SQLite, and Oracle, whereas Rails is mainly designed to work with PostgreSQL.
3. **MVC Framework**: Django follows the MTV (Model-Template-View) architecture, while Rails follows the MVC (Model-View-Controller) architecture.
4. **Community and Ecosystem**: Django has a larger community and a broader ecosystem of packages and libraries, making it easier to find solutions and resources, while Rails has a strong community but with fewer resources compared to Django.
5. **Documentation**: Django is known for its comprehensive and well-organized documentation, making it easier for beginners to get started, while Rails documentation can be somewhat scattered and not as beginner-friendly.
6. **Philosophy and Approach**: Django emphasizes "explicit is better than implicit," while Rails adheres to the principle of "convention over configuration," meaning it provides default configurations that developers can override if needed.

In Summary, Django and Rails differ in language, database support, MVC framework, community, documentation, and philosophy/approach.
Advice on Django and Rails
Needs advice
on
DjangoDjangoGolangGolang
and
SpringSpring

So currently I have experience in Node.js, but just to expand my stack knowledge and for getting backend developer roles, I thought of learning another backend-related language/framework. I have heard about Django, Golang, and Spring. I am mostly trying for backend API roles, and far as I've heard, Django REST framework can be a pain to work with. I've heard there are issues with Golang for package management (like how recently the Gorilla web toolkit is archived) and as for Spring, it's a vast ecosystem to learn so not sure if it's worth investing in. I would like to know which tool/framework to learn, which can help me get high-paying jobs and has a lot of scopes, and also which is great for making REST APIs. Any other tool that can do the job better than these three is also welcome!

See more
Replies (1)
Recommends
on
FastAPIFastAPI

Try thats, is really lightweight and little bit similar like node, before you jump on djanggo stuff, hopefully it's helpful https://fastapi.tiangolo.com/

See more
Needs advice
on
DjangoDjangoPHPPHP
and
RailsRails

I'm really interested in building minimalistic web products with extra stuff like Stripe, MongoDB, solidity, WebAssembly and three.js.

Want to choose my backend lang but am unable to choose, my requirement is:

  • fast dev
  • minimal
  • easy to learn
  • good for saas
  • huge community
  • scalable
  • fast and interactive
  • good job market (not important)
See more
Replies (1)
Christian Maersk
CEO/Full-stack developer at QUARY Design ApS · | 6 upvotes · 36.3K views

If you want an ’easy-to-learn’ and ‘fast dev’ environment I would go with React.js, Node.js, and Firebase. This is probably one of the easiest tech stacks to develop and offers great scalability without creating a complicated database structure. Furthermore, it’s almost hard to develop a react application that isn’t lightning fast.

See more
Needs advice
on
DjangoDjango
and
SpringSpring

Should I continue learning Django or take this Spring opportunity? I have been coding in python for about 2 years. I am currently learning Django and I am enjoying it. I also have some knowledge of data science libraries (Pandas, NumPy, scikit-learn, PyTorch). I am currently enhancing my web development and software engineering skills and may shift later into data science since I came from a medical background. The issue is that I am offered now a very trustworthy 9 months program teaching Java/Spring. The graduates of this program work directly in well know tech companies. Although I have been planning to continue with my Python, the other opportunity makes me hesitant since it will put me to work in a specific roadmap with deadlines and mentors. I also found on glassdoor that Spring jobs are way more than Django. Should I apply for this program or continue my journey?

See more
Replies (2)
Recommends
on
DjangoDjango

I would recommend you change and get the easy path, but there's no easy path. When you are working in something like development you have to learn every day, stick with a specific niche, learn from others to apply to yours, and improve to be a specialist. If Spring and Java are technologies you're not enjoying, why are you going to waste your time with them? If you check the market, the higher salaries are in the specialization. For example, I was sticking with Erlang and Elixir in high volume, high availability, and concurrent systems. Don't check the number of works about Python, Java, or whatever else, you only need one job, and you have no idea about the quality of these. Most of the demanding jobs for Java, Python, and PHP are usually not covered because they request a lot and pay too less. Believe me, there are not a lot of Erlang and Elixir jobs and I always found one. And finally, don't expect too much from big companies, they are all glamorous from the outside, but they are usually a deception when you start working for them.

See more
Axel Dürkop
at Hamburg University of Technology · | 5 upvotes · 44.7K views
Recommends
on
DjangoDjangoFlaskFlask

Hi Mohamed, I love Django for its "batteries included" philosophy, meaning that you get the backend for free and a lot of stuff for database abstraction. But often you just need some kind of webserver backend logic and Django is oversized for that purpose. In that case I go with Flask which has a modular approach so that you need to gather the parts yourself that you need. If you come from a Python background I think there is a lot to explore with Python for the web and it very well into the data science landscape.

See more
Quade Claxton
Needs advice
on
DjangoDjango
and
SymfonySymfony

Hi everyone! I'm starting a personal project that I've been postponing for a little while and I need a bit of advice. I thought that it will be a bit of a challenge but I figure the best way to learn is by doing!

The plan is to build an app with loads of automation build in for reporting which would make it very easy to perform tasks, The plan is to build something similar to an HR app using microservice architecture, separating services e.g. employee data, payroll (including calculations based on easily entered info like tax %), employee services (vacation, sick day allowance booking and tabulation) and automated reporting on a pre-defined schedule (bi-weekly, monthly).

I am considering Django (as I currently know a bit of Python) and Symfony (as a friend who is a developer recommended it) but I am well aware there are other (and probably better) tools out there for the job (like maybe ExpressJS/Node.js for the backend and React/Vue.js for the front).

Background:

I have got knowledge as a DevOps, Site Reliability and Cloud engineer so once the app is built I'm very comfortable taking it to deployment.

Thank you all for your help and responses.

See more
Replies (1)
Ibrahim Gunduz
Software Developer at PayU · | 2 upvotes · 45.3K views
Recommends

Hi. I guess it all depends on what your goal is. If you wanna make fast prototyping Django or ExpressJNodeJS might be really good candidates. You can write your services quickly and easily by using anyone of them. Maybe we can also put Laravel in the same category.

Symfony is also another application framework that comes with many reusable components. It provides great flexibility with the configuration and dependency management solutions. So that you can inject or override anything, anytime without doing something hack-ish. You don't have to depend on any components that come with the framework and, replace them with whatever you prefer unless encounter any integration issues. I can say that Laravel also provides most of the Symfony futures as it uses its components under the hood. However, my personal experience with Laravel was not so good because it made me feel like I use a modernized version of Codeigniter. But anyway. :) So if I have to choose one of them, I would choose Symfony.

From the backend perspective, all of those have some pros and cons. For example, If strict type declaration is important for you and you don't like code magics like monkey patching etc., maybe Python and NodeJS might not be good candidates and maybe you could choose Symfony/php. However, in this case, you'll be missed out on the most powerful future of NodeJS which is non-blocking io. if you plan to do IO-intensive works, I think it would be a big loss.

So, maybe I can recommend you to have a look at typescript + NestJS also. https://nestjs.com/ The futures that NestJS provides might be a good balance between the strengths of Symfony and NodeJS.

As I'm backend dev., I haven't work too many frontend projects but from my personal experience, I loved ReactJS more than Vue although Vue was simpler. Maybe a front-end developer can give us more helpful details about those.

Hope it helps.

See more
Needs advice
on
DjangoDjangoLaravelLaravel
and
RailsRails

I am wondering which language would you guys suggest learning if productivity & "future-proofing" is the focus?

I have now 2 years of experience with React Native & Firebase and 3 years of experience with Next.js and ExpressJS. As I like the idea of separating backend & frontend I think as a solo developer the MVC approach will get you way further and overall I started second guessing the whole js ecosystem and its quality.

What I am currently considering the most is Django, even if I am giving up major productivity I think the opportunities Python offers with AI/ML & scrapping are way superior then Rails. I would like to know how much productivity would get lost by deciding on Django.

See more
Replies (1)
Recommends
on
DjangoDjangoPythonPython

Python is simple to read. Easy to use and import libraries. It is widely used in many different application domains. It is very easy to learn compared to other languages.

Considering your background is in front end technology; why not try some other language that can help you become more well rounded? Besides, there are always more and more python jobs.

Django is very easy to learn. If you use Django, I recommend the Django-Rest-Framework. This will save you a lot of time. But you need to understand some Python first. I think Python is as simple as: interpreted, dynamically typed language where you use lists and dictionaries a lot.

See more
Needs advice
on
DjangoDjangoFirebaseFirebase
and
LaravelLaravel

I need advice. Am currently building a real estate marketplace mobile app using Flutter for frontend. I am not sure which backend solution to use, and thinking of using Firebase, Django or Laravel for backend and MongoDB/MariaDB for the database. I want to build an API backend and then use RESTful API calls for the frontend.

See more
Replies (1)
Recommends

I think you should first choose either a database or server side programming language then you can streamline your other choices based on that, but I think if you are building a big project then going with django + firebase / mongodb would be a good choice else choose laravel + firebase.

See more
Needs advice
on
DjangoDjangoLaravelLaravel
and
SpringSpring

Hi all. I want to rewrite my system. I was a complete newbie 4 years ago and have developed a comprehensive business / finance web application that has been running successfully for 3 years (I am a business person and not a developer primarily although it seems I have become a developer). Front-end is written in native PHP (no framework) and jQuery with backend and where many processes run in MySQL. Hosted on Linux and also sends emails with attachments etc. The system logic is great and the business has grown and the system is creaking and needs to be modernised. I feel I would stick with MySql as DB and update / use Django / Spring or Laravel (because its php which I understand). To me, PHP feels old fashioned. I don't mind learning new things and also I want to set the system up that it can be easily migrated to Android/iOS app with SQLite. I would probably employ an experienced developer while also doing some myself. Please provide advice -- from my research it seems Spring/Java is the way to go ... not sure. Thanks

See more
Replies (4)
Recommends
on
LaravelLaravelVue.jsVue.js

PhP might be old fashionned but Laravel is really great. I've tried nodeJs backend with express, python with flask and a little bit of serverless, and quite frankly, laravel was by far the best in my opinion. It has a lot of official packages that speeds up development (from authentification to serverless deployement), it also uses Eloquent ORM that support Mysql databases. Finally it works great with VueJs for the front end development.

See more
Harry Jin

I recommend ExpressJS or NestJS as BackEnd and React as Front-End and PostgreSQL as the database. The reason is as follows. First of all, since it is a financial system, various services will exist, and each service must be well connected and combined with each other. The organic combination of small services that work very well is the foundation of a great system. For this, it is best to use Node.js based, and I think ExpressJS or NestJS is the best choice. We recommend choosing React or Vue as the FrontEnd. PostgreSQL is currently the best performing database. These three combinations have many examples, and their superiority has been confirmed by my implementation in many projects already. If you are interested in my advice and have any questions, please feel free to contact me.

See more
Jayson Pamittan
Software Engineer - Level III at Arch Global Services · | 4 upvotes · 93.2K views
Recommends
on
LaravelLaravel

On my end for me it's better to choose Laravel. It has very good documentation and easy to code. The framework supports MVC and you can create either monolithic or API only. The community is also big. If you combined a Domain Driven Development (DDD) and Test Driven Development (TDD) on Laravel then it will be a superb.

See more

Since you are using PHP more natural is Python - it can handle high traffic - Python is very effective in coding. Python is superset of Java and C++ - True Object Oriented and have very clear syntax (Spring is hard to learn and debug - you can be confused many times). It is human readable you can code 2-4 times faster with small speed sacrifice. Jinja2 is more faster/flexible Django - whatever Django is better with ORM. Flask is just proposal - many other options of web servers.

See more
Amir Beheshtaein
Needs advice
on
JavaScriptJavaScriptNext.jsNext.js
and
RailsRails
in

I've inherited a monolithic Rails app for an MVP product. We're planning to slowly migrate away from RoR to build the remaining parts of the app. App requirements: - Video streaming w/ audio - Real time chat - User authentication & roles - Payment system Performance, scalability, and attracting dev talent(s) are important to our team.

I'm considering the microservices approach, SSR + CSR & caching with Next.js (prefer Svelte-kit but it's in beta). I also prefer to keep this a full JS household. What other JavaScript frameworks/libs would you recommend? Keep in mind the existing RoR will not be deprecated. We'll be consuming the APIs and slowly moving away from them until they can safely be deprecated.

See more
Replies (2)
Paul Keen
Recommends
on
RailsRailsStimulusStimulus

Moving from Rails will reduce development velocity (if you want to have easy support and update the app) and will require more skilled (expensive) developers to support it.

Without previous experience (5+ years) do not suggest moving to node.js. That code will easily become hard to learn and support.

You always can implement microservices with Ruby, but this approach should be considered only after Series-A and when you will have more than 5 developers and dedicated SRE/DevOps.

See more
Ray Arayilakath
Full-stack Developer && Software Engineer at Self-employed · | 4 upvotes · 19.1K views

I see it's been some time since this was posted, but I'm glad you are migrating to Next.js 🎉!

Me personally, I would run an Express.js backend so that frontend and backend logics don't feel blurred, especially if you want to attract more developers to your project. Keeping frontend separated from the backend makes for a healthier workspace ecosystem and often confuses people less. Furthermore, implementation is a lot easier and later on as you move from RoR to an Express.js server there won't be too much confusion as to how certain parts mesh together.

Based on the features you're looking at I would consider using websockets (WSS or Socket.IO) for the chat application or rolling that with features from WebRTC, which you would need to support video streaming anyways. For authentication you could look at Auth0 which has some very nice libs for authentication or you could rig up your own stitching individual OAuths (Google, Facebook, etc.) along with a simple User/Pass signup that you manage in your database. For payment I would consider using Stripe, it's very popular in the JS ecosystem right now, has lots of documentation and features, and is also pretty cost-effective.

I know it's been some time since you have posted this and you have already made some decisions, but if you (or anyone else reading this) has any question feel free to let me know :)

See more
Aleyna ARSLAN
Entrepreneur at Oblong Digital Marketing & Ads · | 5 upvotes · 87.3K views
Needs advice
on
DjangoDjango
and
.NET.NET
in

Hi everyone, I have a new venture project, we do frontend development mainly with Tailwind CSS, JavaScript, CSS, HTML, and React. This project will run on a cloud platform and it will be a web platform with data analysis. At Backend, we can't decide which technology to continue with. We will necessarily use Python for data analysis and algorithms, but should the backend be written with Django or C# .NET, can I get your suggestions within the cloud platform? Price performance is our priority.

See more
Replies (2)
Miles Fawcett
Recommends
on
DjangoDjango

If you are already committed to Python for the data analysis then it would make sense to use Django for the framework and stick with Python throughout. In general the fewer technologies you use (unless there is real justification) will improve process and long term costs.

All things being equal the fact you would not have less (likely no) licensing costs with a Python based solution will overall reduce your long term costs.

See more
Recommends
on
DjangoDjango

If you will be doing data analysis and complex algorithms Django is best suited for this because of it' maturity and the huge communities providing lots of Python libraries for data analysis and more.

See more
Needs advice
on
DjangoDjangoRailsRails
and
SpringSpring
in

Hi everyone! I'm starting a personal project that I've been postponing for a little while and I'm starting with the backend first.

  • It's an app that needs to query open APIs (It could go up to a hundred APIs) and do filtering and other manipulations onto the data and then store it in my own database. So basically, the end result medium/long term is a lot of data!

  • Besides filtering/storing data from other APIs, the API will interact with my client application. I should note that the client app attempts to give real-time information.

Question: I would want to launch the API within 6 months as I'm also planning to make it available for other devs through platforms like RapidAPI. With all being said, my question is twofold:

  1. Which backend framework would allow me to do these operations with the best response time possible?

  2. Which framework would be the easiest to deal with deployment on AWS?

Background:

I have a background in Spring since I'm using it at work, I have none in Rails and Django but I don't mind trying something new as long as the learning curve isn't crazy. I know python but not Ruby. Beginner on AWS and choose that one after some research.

Thank you very much, sorry it was a bit long. Cheers

See more
Replies (1)
Jorge Velasco
Full Stack Developer at Fintual · | 8 upvotes · 89.6K views

The most relevant part is the central architecture more than the specific backend. For me, it makes sense to go for an event-driven solution. In this case, an event is emitted on every new data, and one or more listeners react to it. In AWS, you can easily get this by storing your data in DynamoDB, which is pretty fast, and have as many lambdas working on the received data (here you can find more details). This way, you keep your worker(s) busy fetching data while others consolidate it. I wouldn't get too crazy on the lambdas, and I'd start with one as there will be only one client by your description. My only concern is how similar the APIs you're consuming are. Depending on that, it may be easier to have different lambdas by target API. My only note on the backend language is that if you want low latency, I'd discard Python and Ruby and choose Go (I know that is not in the list, but given that you're open to learning a new language, you could give it a try). It is easy to learn, has excellent performance, and is the only Lamdba runtime with an X (1.X) in the supported language, making it a great choice.

See more
Decisions about Django and Rails
SamuelBonilla
Senior Developer at Graphul · | 20 upvotes · 29.9K views

Graphul is an Express inspired web framework using a powerful extractor system. Designed to improve, speed, and scale your microservices with a friendly syntax, Graphul is built with Rust. that means Graphul gets memory safety, reliability, concurrency, and performance for free. helping to save money on infrastructure.

See more
Mark Esser
Team Lead Talent Acquisition at i22 Digitalagentur GmbH · | 8 upvotes · 102.7K views

A developer and project manager from our team X says the following about our use of Rails at i22:

"We use Rails to build stable and flexible backend systems. Rails is extremely good for managing data structures and quickly setting up new systems. It is the perfect base for most use cases."

I asked the same Team X member why the team prefers to work with Ruby on Rails, rather than Python and Django:

"Because Python is a scripting language and from my point of view not suitable for building stable web services. Python is for me rather good for scripts and fast small tools. Not for stable business applications. And if I want it fast I prefer Go."

See more
Saulius Kolesinskas
Engineering Manager at Vinted · | 11 upvotes · 21.1K views

In 2017, we decided to move away from Backbone and embrace a relatively new tool which was taking the industry by storm, React. Since Backbone was no longer actively maintained and its popularity was falling, it made sense to adopt a tool that was on the rise and promised improved performance, developer experience and delivery speed. In addition, it became easier to hire Frontend Engineers as the talent pool greatly increased. Nowadays, React is the framework of choice across Vinted.

Typescript entered the picture at a later stage. We placed our initial bet on Flow but it soon became obvious that the industry prefers Typescript. In 2019, we migrated to Typescript and never looked back. Having a strongly typed language in our frontend brought confidence to the engineers and greatly reduced the number of bugs.

Next.js is the newest addition to the stack. Vinted is currently a Rails monolith and React on Rails is used to render views. In order to transform Vinted to a single-page application (SPA) and split backend from frontend, we decided to adopt Next.js. Among the options considered, Next.js offered the most comprehensive feature set, good support for Server Side Rendering (SSR) and a vibrant community. We also expect that splitting the client-side would lead to improved developer experience and faster builds.

See more
Tyrell Perera
Director - Software & Systems Engineering at Telstra · | 5 upvotes · 85.9K views
Migrated
from
DjangoDjango
to
Spring BootSpring Boot

I inherited a large Python Django application as part of a corporate re-structure. After careful analysis, working with the new team, we decided to break the monolith into a microservices architecture. While doing so, we managed to port some of those microservices into Spring boot. Better performance and widely available expertise within my current team made me make this decision.

See more
Ing. Alvaro Rodríguez Scelza
Software Systems Engineer at Ripio · | 12 upvotes · 357.3K views

I was considering focusing on learning RoR and looking for a work that uses those techs.

After some investigation, I decided to stay with C# .NET:

  • It is more requested on job positions (7 to 1 in my personal searches average).

  • It's been around for longer.

  • it has better documentation and community.

  • One of Ruby advantages (its amazing community gems, that allows to quickly build parts of your systems by merely putting together third party components) gets quite complicated to use and maintain in huge applications, where building and reusing your own components may become a better approach.

  • Rail's front end support is starting to waver.

  • C# .NET code is far easier to understand, debug and maintain. Although certainly not easier to learn from scratch.

  • Though Rails has an excellent programming speed, C# tends to get the upper hand in long term projects.

I would avise to stick to rails when building small projects, and switching to C# for more long term ones.

Opinions are welcome!

See more

We’re a new startup so we need to be able to deliver quick changes as we find our product market fit. We’ve also got to ensure that we’re moving money safely, and keeping perfect records. The technologies we’ve chosen mix mature but well maintained frameworks like Django, with modern web-first and api-first front ends like GraphQL, NextJS, and Chakra. We use a little Golang sparingly in our backend to ensure that when we interact with financial services, we do so with statically compiled, strongly typed, and strictly limited and reviewed code.

You can read all about it in our linked blog post.

See more

This website was originally written in Yii as PHP was my main language back then. After learning Django, I realized just how quickly you could build a web app with less lines. So I migrated my website to Django in a week or two and managed to cut down the lines of code by half. Some of the lines saving came from the models, the views, and the expressiveness of Python. Django requires like config for the models and they provide many generic views that abstracts away common patterns.

See more

I am planning to develop project management system SAAS based. Can any one help me with selection of platforms from Django or Laravel and for database MongoDB or Firebase/Firestore or MySql? On front end I am going to use Quasar Framework (VueJS). Note : project will be Webapp, Mobile app and desktop app.

See more
Shiqi Lin
Software Developer at BigClarity · | 3 upvotes · 212.9K views

We will use Django to set up our backend and Django REST Framework (DRF) for our API creation. The easiness of performing development tasks (eg. user authentication, URL routing, and schema migration) attracts our attention. Also, Django with PostgreSQL provides many benefits: 1. Some data types in Django will only work with PostgreSQL; 2. Django offers django.contrib.postgres to operate on PostgreSQL; 3. Django supports many features of PostgreSQL. Moreover, Django is compatible with Redis.

See more
Hampton Catlin
VP of Engineering at Rent The Runway · | 7 upvotes · 423.9K views

Starting a new company in 2020, with a whole new stack, is a really interesting opportunity for me to look back over the last 20 years of my career with web software and make the right decision for my company.

And, I went with the most radical decision– which is to ignore "sexy" / "hype" technologies almost entirely, and go back to a stack that I first used over 15 years ago.

For my purposes, we are building a video streaming platform, where I wanted rapid customer-facing feature development, high testability, simple scaling, and ease of hiring great, experienced talent. To be clear, our web platform is NOT responsible for handling the actual bits and bytes of the video itself, that's an entirely different stack. It simply needs to manage the business rules and the customers experience of the video content.

I reviewed a lot of different technologies, but none of them seemed to fit the bill as well as Rails did! The hype train had long left the station with Rails, and the community is a little more sparse than it was previously. And, to be honest, Ruby was the language that was easiest for developers, but I find that most languages out there have adopted many of it's innovations for ease of use – or at least corrected their own.

Even with all of that, Rails still seems like the best framework for developing web applications that are no more complex than they need to be. And that's key to me, because it's very easy to go use React and Redux and GraphQL and a whole host of AWS Lamba's to power my blog... but you simply don't actually NEED that.

There are two choices I made in our stack that were new for me personally, and very different than what I would have chosen even 5 years ago.

1) Postgres - I decided to switch from MySql to Postgres for this project. I wanted to use UUID's instead of numeric primary keys, and knew I'd have a couple places where better JSON/object support would be key. Mysql remains far more popular, but almost every developer I respect has switched and preferred Postgres with a strong passion. It's not "sexy" but it's considered "better".

2) Stimulus.js - This was definitely the biggest and wildest choice to make. Stimulus is a Javascript framework by my old friend Sam Stephenson (Prototype.js, rbenv, turbolinks) and DHH, and it is a sort of radical declaration that your Javascript in the browser can be both powerful and modern AND simple. It leans heavily on the belief that HTML-is-good and that data-* attributes are good. It focuses on the actions and interactions and not on the rendering aspects. It took me a while to wrap my head around, and I still have to remind myself, that server-side-HTML is how you solve many problems with this stack, and avoid trying to re-render things just in the browser. So far, I'm happy with this choice, but it is definitely a radical departure from the current trends.

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More