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

Django

36.9K
33.3K
+ 1
4.2K
Laravel

27.4K
22.8K
+ 1
3.9K
Add tool

Django vs Laravel: What are the differences?

Introduction

In this article, we will explore the key differences between Django and Laravel, two popular web development frameworks. Both Django and Laravel make it easier for developers to build web applications efficiently, but they have distinct characteristics that set them apart.

  1. Language: Django is a web framework built with Python, a general-purpose programming language, while Laravel is a PHP-based web framework. The choice of language can affect factors such as developer familiarity, ecosystem support, and performance optimizations.

  2. Architecture: Django follows the Model-View-Controller (MVC) architectural pattern, where the responsibilities are divided between models, views, and controllers. On the other hand, Laravel follows the Model-View-Controller (MVC) architectural pattern as well, but it also integrates additional concepts like routing, middleware, and blade templating engine.

  3. Database Support: Django provides built-in support for multiple databases including PostgreSQL, MySQL, SQLite, and Oracle. It offers a consistent and efficient Object-Relational Mapping (ORM) layer called Django ORM. Laravel also supports various databases including MySQL, PostgreSQL, SQLite, and SQL Server, but it uses Eloquent ORM for database operations.

  4. Authentication and Authorization: Django comes with a robust authentication system that handles user registration, login, and permissions out of the box. It provides fine-grained control over user roles and permissions. Laravel also provides authentication features but has a more flexible system with various authentication drivers and guards, allowing developers to use session-based, token-based, or other custom authentication methods.

  5. Community and Ecosystem: Both Django and Laravel have active and supportive communities, but Laravel's community is relatively larger. Laravel offers a rich set of packages and extensions available through Laravel's package manager, Composer. Django also has a wide range of packages available through Python's package manager, pip, but the Laravel ecosystem provides more specialized tools and resources for web development.

  6. Ease of Learning: Django is known for its "batteries included" philosophy, providing a comprehensive set of tools and libraries. While this makes Django powerful, it can also have a steeper learning curve. Laravel, on the other hand, focuses on simplicity and elegance, making it easier for beginners to understand and start developing web applications quickly.

In summary, Django and Laravel have various differences including the programming language used, architectural patterns, database support, authentication systems, community size, and learning curve. Choosing between the two depends on factors such as project requirements, developer proficiency, and ecosystem preferences.

Advice on Django and Laravel
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.6K 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 · 45K 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.6K 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
Farrukh Zeeshan
Senior Immigration Consultant · | 6 upvotes · 39.7K views
Needs advice
on
LaravelLaravel
and
Node.jsNode.js

What should be used Node.js or Laravel to create a course search portal having about 50K courses, where users will create a profile and enter their academic credentials, scores, language tests, fee range, subject area, etc, and the system will filter and suggest courses meeting the entry requirements and other criteria. The applicant will then shortlist courses, he should be able to compare courses, apply for courses, upload documents and fill in application details, etc.

See more
Replies (1)
Peter Forret
Technical Director at Brightfish · | 4 upvotes · 27.1K views
Recommends
on
LaravelLaravel

It's not a fair comparison. Laravel is a PHP web framework, Node is a web server runtime around JS. The question should be either:

  • PHP or Node? => take what you know/can work fast in
  • Laravel or ExpressJS/MeteorJS => take what you know/can work fast in

If it were up to me, I'd choose Laravel because I know it and can work fast in it :-)

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
Shanover Saiyed
Software Engineer (Web) · | 4 upvotes · 68.5K views
Needs advice
on
LaravelLaravel
and
Node.jsNode.js

I'm working as a full stack web developer and have been given an opportunity to re-frame the whole website which is written in PHP and JavaScript. Our website is required to be fast, efficient, having good analytics, easy to maintain and rework, and subject to frequent changes. It would be handling some medium size files like resumes, video recordings, etc. So I am thinking of changing the tech stack but confused for which backend to choose for the long run. Which back-end would prove to be better in terms of learning, development, and maintenance?

See more
Replies (2)
Recommends
on
Node.jsNode.js

If it was me, then I would go with node.js because it has huge a number of packages,community,support & good dev experience and learning curve is also not that steep, if coupled with express.js, its gonna be efficient and fast in serving web requests, and if we adopt good design patterns and follow best practices, I guess it will be easy to maintain it as well, and for storing resumes, video rec etc.., I would use assest management tools like cloudinary etc.., rather than storing in db, coz Its gonna be much more faster this way.

See more
Recommends
on
Node.jsNode.js

Nuxt + Fastify + GraphQL + Nginx + Memcache = fast, confortable and a lot of plug-ins. Apache is realy slow :(. Nuxt is great and easy to use. Nginx, Memcache and Fastify it's very efficient. GraphQL require much more from You then REST, but give You flaxibility, order, plugin etc. We tried and don't regret .

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.7K 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
Aleyna ARSLAN
Entrepreneur at Oblong Digital Marketing & Ads · | 5 upvotes · 87.7K 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
Decisions about Django and Laravel
SamuelBonilla
Senior Developer at Graphul · | 20 upvotes · 30.2K 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 · 103.4K 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
Jayson Pamittan
Software Engineer - Level III at Arch Global Services · | 13 upvotes · 84.5K views

Laravel is so very friendly in coding in backend and has a good documentation and easy to understand. It's also easy and rapid to create application on this framework. The community is also big where you can get a lot of other solutions from other developers. Same as well in Vue Js, its lightweight and very fast to compile and load. The coding is very well structured and clean. PHP has now also the features of strict type rules and Vue Js too since it's now support Typescript.

See more
Danilo Polani
Senior Software Engineer at WeRoad · | 7 upvotes · 91.4K views

For a full-stack app or just simple APIs I'd go 100% with Laravel. You get a clean architecture, beautiful documentation and friendly and always growing community: the project is yours, from A to Z. With their docs and resources like Laracast you can start from zero and build what you want, when you want. The learning curve is definitely smaller when compared to Symfony and, with the help of a bit of "magic" (Facades etc.) you get the same results in the half of the time with cleaner code.

See more
Tyrell Perera
Director - Software & Systems Engineering at Telstra · | 5 upvotes · 86.2K 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

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 · 213.5K 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
Chose
RailsRails
over
DjangoDjango

I have used both the tools . Both of them are super awesome , very reliable and their learning curve is also super easy. But, the reason I choose Ruby on Rails over Django is the fact that the dependency injection is super easy in Rails than Django. What I mean is the fact that, Django requires a lot of import statement to do a lot of work, which remembering is not so easy and even after that you may need to write a lot of code. But Ruby on Rails uses gem to add addition feature or dependency in the project. Which requires just copying the gem statement from github and pasting it in the Gemfile, then running bundle install(these days just bundle works super fine). And there you are with the new feature in your app. You can see this with the example of Authentication, where in Django you require several steps like adding class based views and many more, but in rails it's just as easy as installing the 'devise' gem . And if you want to make it beautiful use bootstrap_template gem to make it look prettier. Now with Rails 6 , Rails is a total developer's fervent friend because it has come up with features like Action Mail and Action Text.

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