Nvim

Nvim

Django vs Phoenix

Anybody knows a comprehensive comparison of Django and Phoenix, thanks for the help.

  • Where are they similar?
  • Where do they differ the most?
  • When would you use/recommend either?
  • Anything else you’d like to share?

Most Liked

mikemccall

mikemccall

Based on my current experiences here is my take. I don’t have a comprehensive guide, but beyond handling web request and mostly following mvc they are not all that similar. Django has models and an ORM phoenix uses schemas with Ecto. Django’s use of “apps” fall in line with using contexts but each django app has it own mvc file structure. Which I have to admit I like. Django is also bloated with features and can serve a very wide range of web projects out of the box. It comes with a ready to go admin. Phoenix is explicit while django is implicit. I applaud both Phoenix/Elixir and Django for the excellent documentation.

Both communities are generally pleasant. Phoenix doesn’t take on user land solutions. For example authentication/authorization. Phoenix leaves the decision up to you, while django comes with it (including password upgrading). The elixir phoenix community hasn’t quite caught up with some of the other popular django apps such as Wagtail and saelor. But it will.

That being said django does not even come close to providing the ease of use when working with realtime. The phoenix team has done an amazing job adding realtime capabilities (my biggest pull to phoenix). With phoenix you also get the benefits with running on the beam. Phoenix has liveview which is very nice. I’ve already seen community members of django, crystal, and laravel implement their own versions. But those will not be as scalable.

Overall my default is elixir/phoenix. It’s fast and enjoyable. There are more than enough community packages to rival django. While “user land” decisions are not made for you by the framework itself, the community has fantastic libraries. The elixir community is full of some really smart experienced people. Pow is a good example of this. The elixir community is very happy to guide you in the right direction. You will not only learn and become a better developer, but you will start to realize those framework abstractions aren’t as hard as they might seem.

All that said, phoenix is probably closer to Flask than Django.

If a client needs cms capabilities, e-commerce or they really can’t be sold on elixir I go with django. Otherwise, elixir and phoenix all the way! Hope that helps.

28
Post #4
dimitarvp

dimitarvp

You already were given excellent answers. My really short version is this:

Do you want to have most of what you need ready-made and able to be put in your project with small initial friction? Go for Django.

Do you want to build part of the required functionality (like authorization and CMS) yourself, while retaining full control on what is going on below the hood? Go for Phoenix.


Have in mind though: apps made with implicit/magic frameworks always come with a high maintenance burden. They allow you to start quicker but you pay off those savings in the future, many times over. A lot of Rails and Django apps are an example of this phenomena.

woeye

woeye

I’ve been working with Django since version 0.9x. So for quite some time now.

There are several things I really like about Django:

  • Excellent documentation. All in one place, nice tutorials, nice examples.
  • Many useful features included, like Sitemap generation, CORS, authentication & authorization, etc
  • A very powerful admin interface which is most often good enough for basic administration tasks

The downside is that concurrency related tasks are very hard to do and requires workarounds like job-queues etc.

Especially the concurrency issues are what brought me to Elixir. And so far I am pretty happy with Elixir/Phoenix. For me the most noteable differences where:

  • The documentation in the Elixir world feels cluttered. Like, lots of packages and you have to jump between packages all the time. Even worse I often wondered why the documentation doesn’t mention feature X until I figured out that I had to look at package X by myself. Take ecto and ecto.migrations for example.
  • Phoenix does a really bad job in terms of self marketing imho. Compare the Django site and then Phoenix. I feel Django does a much better job at explaining why Django is great, getting started tutorials, highlighting its features, etc. In that regard Phoenix indeed feels more like Flask.
  • I feel that Ecto is a bit more low-level compared to Django’s ORM. But I actually like this because it allows me to better facilitate PostgreSQL’s features.
  • The directory layout in Phoenix still feels weird to me, like the difference between :app and :app_web. I rather prefer Django’s app approach, which are fully contained including views, templates, url mappings, etc.
  • One thing I really miss from Django is the admin feature. In countless projects it was a huge time saver.

Where Next?

Popular in Discussions Top

jeramyRR
This is an interesting article to read. Elixir’s performance, like usual, is excellent. However, it seems like the high CPU usage is co...
New
blackode
Elixir Upgrading is so Simple in Ubuntu and It worked for me Ubuntu 16.04 git clone https://github.com/elixir-lang/elixir.git cd elixir...
New
New
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19148 150
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31107 143
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
hazardfn
I suppose this question is effectively hackney vs. ibrowse but we are at a point in our project where we have to make a choice between th...
New
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I fore...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35953 110
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31107 143
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47849 226
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

We're in Beta

About us Mission Statement