Learning Django or Rails: the honest learning curve
TL;DR
Difficulty: Beginner
- Learning a framework is three curves: the language, the framework and the ecosystem (tests, deployment, front end).
- Rails lends you understanding: a working app in week one, then a wall in weeks two to six (autoloading, implicit rendering, generated methods, callbacks, concerns).
- Django charges up front: a slower first day of explicit wiring, then harder questions about querysets, class based views and the front end.
- Python is taught far more widely than Ruby, which helps beginners most.
- Expect a learning tax of about a quarter of the first six months in either framework. Test the wall, not the honeymoon, and judge developers by whether they can trace behaviour to its source.
What to read first
"A weekend" and "a few years" are both true answers to how long it takes to learn Django or Rails, and neither helps anyone plan. Here is the honest version: the three curves you climb, where each framework gets hard and why, a realistic timeline, and what the learning costs in a real six month budget.
The question, and why the usual answers do not help
Ask how long it takes to learn Django or Ruby on Rails and you will hear two kinds of answer. One says "a weekend": follow the tutorial, and by Sunday evening you have a working blog. The other says "years": you only really know a framework once you have kept a real application alive through several upgrades. Both are true, and neither helps a founder plan a budget or a developer plan a month.
This chapter answers the real question: how long does it take to become productive in each, and what exactly makes each one hard? Productive here means something specific, which I define below. The answer is an estimate, not a measurement, and I say so wherever it matters. What I can give you with confidence is the shape of each learning curve, where its hard places are, why they are there, and how to plan around them.
I build web applications on Ruby on Rails, so read my view with that in mind. I have tried to describe both frameworks so a senior Django developer would nod at every comparison.
If you have not read the first chapter of this series, Django or Rails: two answers to the same question, start there. It explains the two philosophies this chapter keeps coming back to. The second, where Django shines and where Rails shines, maps which products suit which framework.
The example throughout is invented. Freewheel Cycles runs six bicycle repair workshops in and around Limerick (freewheelcycles.example), with 38 mechanics, about 1,150 repair bookings a week and 9,000 active customers. Niamh, the founder, wants to replace a set of spreadsheets and a rented booking widget with the company's own web application. Her two developers are Aisling, who has four years of Python (mostly data analysis, a little Flask), and Cian, who has three years of JavaScript and TypeScript with React. Neither has written Ruby. The budget for the first version is six months.
Rails lends you understanding, Django asks for it up front
Here is the idea the rest of this chapter hangs on. Both frameworks make you pay for understanding. They just bill you at different times.
Rails gives you a working application before you understand it. Its doctrine says so openly: there are conventions "a beginner doesn't even need to know about"1. You get the productivity now, and the understanding is a loan. The loan falls due a few weeks later, usually on the day something behaves unexpectedly and you cannot see where the behaviour comes from. That is the wall Rails developers talk about.
Django asks you to understand more before it gives you much. You create a project, then an app, register the app in the settings, wire a URL to a view by hand and name the template yourself. Its own design philosophy says magic should only happen when it buys a huge convenience and does not confuse people learning the feature2. So the first day is slower, and in return there are fewer surprises later. Django's bill arrives in a different form: as choices. Which of several ways should this view be written? Which of several front end approaches should this product use? Why did this page run 40 database queries?
I call this the comprehension loan. Rails lends, Django charges up front, and each has its own kind of interest. Keeping it in mind changes three practical decisions:
- When you schedule the hard learning. With Rails, budget for the wall in weeks two to six. With Django, budget for the slow start and the front end decision.
- How you evaluate a framework. A two week trial measures the honeymoon, not the wall. You have to test the wall on purpose (I show how below).
- How you judge a developer. Someone who has only enjoyed the loan can build quickly in Rails and still not know why their code works. The test for real skill is whether they can trace behaviour back to its source.
Example: the first afternoon at Freewheel
Cian has never touched either framework. On his first afternoon he builds the same thing twice: a list of today's bookings.
In Rails he runs one generator, bin/rails generate scaffold Booking starts_at:datetime customer_name:string, then bin/rails db:migrate, and opens /bookings in the browser. There is a list page, a form, an edit page and a delete button. He has written no code and understands almost none of what was generated. He is delighted, and he is in debt, though nobody has told him yet.
In Django he follows the official tutorial's pattern. He runs django-admin startproject freewheel, then python manage.py startapp bookings, adds "bookings" to INSTALLED_APPS in settings.py, writes a model, makes and runs a migration, writes a view function, creates bookings/urls.py, includes it from the project's urls.py, and creates a template at the path the view names. By the end of the afternoon he has one list page, and he could explain every line of it. He is slower, and he owes nothing.
Neither afternoon tells you which framework is better. It tells you when each one will ask Cian to do the hard thinking.
The learning curve is three curves
"Learning Django" or "learning Rails" is really three things learned at once, and they move at different speeds:
- The language. Python for Django, Ruby for Rails. Syntax, the standard library, how the language thinks about objects, errors and collections.
- The framework. How a request becomes a response: routing, models and the database layer, views or controllers, templates, forms, settings, and the conventions that connect them.
- The ecosystem and conventions. Everything a real application needs that the tutorial skims: how tests are written and run, how the application is deployed, which front end approach the team uses, which packages or gems are trusted, how upgrades work.
Most "how long" answers measure only the second curve, and only its first week. The language curve is the shortest for an experienced developer. The ecosystem curve is the longest for everyone, and it is where most real projects lose time.
Example: what Aisling and Cian already carry
Here is what each developer brings to each curve. The point of the table is that experience transfers unevenly.
| Curve | Aisling in Django | Aisling in Rails | Cian in Django | Cian in Rails |
|---|---|---|---|---|
| Language | Done: Python is her daily language | New: Ruby, but the ideas map from Python | New: Python | New: Ruby |
| Framework | Partly: Flask taught her routes, views and templates | New, but Flask concepts still map | New | New |
| Ecosystem | Partly: pip, virtual environments, pytest from data work | New: Bundler, gems, Rails test tools | Partly: he knows package managers and test runners in general | Partly, the same general knowledge |
| Front end | Weak spot: server templates only | Weak spot | Strong if the product uses React, weak if it uses server templates | Strong in principle, but Hotwire works differently from React |
Aisling has a head start in Django on two curves out of three. Cian starts roughly level in both. That asymmetry matters more to Freewheel than any general claim about which framework is "easier".
The language curve: Python is far more widely taught, Ruby is smaller but readable
Python is one of the most widely used and taught languages in the world. Ruby is a smaller community. Two independent sources, measured in very different ways, agree on that much.
The Stack Overflow Developer Survey 2023, published on 13 June 2023 with around 90,000 responses, asked which languages people had used in the past year3. Python was used by 49.28% of all respondents and 56.57% of people learning to code. Ruby was used by 6.23% of all respondents and 2.55% of learners. For frameworks, Django was used by 11.47% of respondents and 13.52% of learners, Ruby on Rails by 5.49% and 1.80%. A survey is not a census: it counts the people who answered a Stack Overflow survey, which leans towards people who use Stack Overflow. The direction is still clear.
The TIOBE Index for December 2023 ranks Python first with a rating of 13.86% and Ruby 19th with 0.77%4. TIOBE does not count developers or code. Its rating is built from search engine results for each language, reflecting skilled engineers, courses and third party vendors, and TIOBE itself says it is not about the best language5. Treat it as a measure of how much is written and taught about a language, which is exactly the thing a learner depends on.
What this means for learning:
- Python has more of everything for a beginner. More courses, more answers to beginner questions, more people around you who already know it. A complete beginner will find Python easier to learn alone.
- For an experienced developer, the language curve is short in both. Both are dynamic, strongly typed, object oriented languages with closures and a good interactive console. The official "To Ruby From Python" page lists the similarities first: an interactive prompt, lists and dictionaries with familiar brackets, strong and dynamic types, everything an object6.
- Ruby's differences are small but they bite. The same page lists them: only
falseandnilcount as false, parentheses on method calls are usually optional, you can reopen and change built in classes, mixins replace multiple inheritance, and blocks are everywhere6. Ruby's own site describes the goal as making the language "natural, not simple"7.
Example: Aisling's first Ruby surprise
Aisling writes a check for the nightly parts reorder report: if a part has nothing in stock, flag it. In Python she would write this:
# Python: zero is falsy, so "not in_stock" is True when in_stock == 0
in_stock = 0
if not in_stock:
print("reorder") # prints "reorder"
She translates it to Ruby line by line:
# Ruby: only nil and false are falsy, so 0 counts as true
in_stock = 0
puts "reorder" unless in_stock # prints nothing
Nothing prints. In Ruby, 0 is a perfectly good, truthy object. The Ruby way states the intent instead:
in_stock = 0
puts "reorder" if in_stock.zero? # prints "reorder"
This is the language curve in miniature. The syntax took her ten minutes. The habits take a few weeks, and the habits are where the bugs hide.
The Rails curve: the first week feels like magic, then comes the wall
Rails is optimised for the first hour and the five hundredth hour. Generators, sensible defaults and a single command to start a server get a newcomer to a working page faster than almost anything else. The official Getting Started guide builds a small blog with articles and comments in one sitting8. It is also honest about the cost: it warns that readers with no Ruby experience will find the learning curve steep, and it calls Rails "opinionated software"8.
Then, somewhere between week two and week six, most newcomers hit the wall. It does not feel like difficulty. It feels like not being able to find things. The behaviour is there, but the code that causes it is not in the file you are reading. Five mechanisms cause almost all of this, and each is documented:
- Autoloading. Rails 7.1 loads your classes with a library called Zeitwerk. If
app/models/booking.rbdefinesBooking, you can useBookinganywhere without arequire. The guide says you do not need, and should not write, arequirefor it9. File names must match the constants they define. Newcomers from Python, where every name is imported explicitly, look for the import that is not there. - Implicit rendering. A controller action that does not call
renderstill renders a template, the one whose path matches the controller and action. The Layouts and Rendering guide names this "convention over configuration in action"10. - Methods nobody wrote. An Active Record model does not list its columns. The API documentation states that Active Record objects infer their attributes from the table definition11. Associations such as
has_many :bookingsadd a family of methods. Routes declared withresources :bookingscreate seven routes and a set of path helpers likeedit_booking_path. - Callbacks. Code can run automatically before or after a record is validated, saved, created, committed or destroyed. The callbacks guide lists the order for creating a record, from
before_validationtoafter_commit, and warns that methods likeupdate_columnskip callbacks entirely12. Behaviour that lives in a callback is invisible from the line that triggered it. - Concerns. A concern is a module of shared behaviour, built with
ActiveSupport::Concern, that a model or controller includes in one line13. The Getting Started guide introduces one in its refactoring chapter8. Useful, and one more place a method can come from.
None of these is a flaw. Each one removes code you would otherwise write and read every day, which is exactly why experienced Rails developers are fast. David Heinemeier Hansson's Rails Doctrine calls Ruby's powerful features "sharp knives" and argues for trusting developers with them1. The cost is that understanding is deferred. The wall is the moment it falls due.
Example: Cian traces one page
In week three, Cian opens the controller for Freewheel's daily booking list:
# app/controllers/bookings_controller.rb
class BookingsController < ApplicationController
def index
# today's bookings, earliest first
@bookings = Booking.where(starts_at: Date.current.all_day).order(:starts_at)
end
end
And the model:
# app/models/booking.rb
class Booking < ApplicationRecord
belongs_to :customer
belongs_to :mechanic
has_one :job_card
# send the confirmation once the booking is safely in the database
after_create_commit :send_confirmation
private
def send_confirmation
BookingMailer.confirmation(self).deliver_later
end
end
And part of the template:
<%# app/views/bookings/index.html.erb %>
<% @bookings.each do |booking| %>
<p>
<%= booking.starts_at.strftime("%H:%M") %>
<%= booking.customer.name %>
<%= link_to "Edit", edit_booking_path(booking) %>
</p>
<% end %>
He has six questions. Each has a precise answer, and each answer lives somewhere other than the file he is reading:
| Cian's question | Where the answer lives |
|---|---|
Where is Booking imported? | Nowhere: Zeitwerk autoloads it from app/models/booking.rb |
Where is starts_at defined? | In the database table, recorded in db/schema.rb, and Active Record infers it |
What is Date.current.all_day? | Active Support, Rails' extensions to Ruby's core classes |
| Who renders the template? | Rails, implicitly, because the action is index in BookingsController |
Where does edit_booking_path come from? | resources :bookings in config/routes.rb |
| Why did a confirmation email go out in my test? | The after_create_commit callback in the model |
There is a seventh issue he has not noticed yet. booking.customer.name inside the loop runs one query per booking to load its customer. With 200 bookings on a Saturday, that is 201 queries. The Active Record query guide calls this the N + 1 queries problem and fixes it with includes(:customer)14. Django has exactly the same trap, as the next section shows. It is a database lesson, not a Rails one.
On the day Cian can answer all seven without asking, he is past the wall.
The Django curve: a slower first day, fewer surprises, three hard places
Django's official tutorial builds a small polls application in eight parts: a public site for viewing and voting, and an admin site for managing polls15. It assumes you know some Python and points newcomers to Python resources first16.
The first day asks for more concepts than Rails does. The tutorial starts with a distinction many beginners find abstract: a project is "a collection of configuration and apps" for a website, and an app is a web application that does one thing, which can live in several projects15. You meet settings.py, urls.py, INSTALLED_APPS and the manage.py command on the first page. This is the up front charge in the comprehension loan. Once paid, it pays back: when Aisling reads a Django view, the imports at the top tell her where every name comes from, and the URL configuration tells her exactly which view handles which address.
Django is not free of hard places. It moves them. There are three that most newcomers meet.
The ORM's query semantics. Django's object relational mapper (ORM) builds SQL from Python. The documentation states that querysets are lazy: creating one touches no database, and you can stack filters "all day long" until the queryset is evaluated17. That is powerful and confusing in equal measure. When does a query run? Why did slicing run one here and not there? Lookups across relationships use double underscores (customer__name__startswith). And, as in Rails, following a relationship inside a loop runs one query per row unless you ask for select_related or prefetch_related18.
Class based views. Django offers views as plain functions or as classes. Class based views reuse behaviour through inheritance and mixins, and the documentation is candid about the price: the more your code is scattered among mixins, the harder it is to read a child class and know what it does19. Generic views also bring back a little implicitness: a ListView for Booking in the bookings app looks for the template bookings/booking_list.html and exposes booking_list to it, unless you say otherwise20. Fairly put, this is where Django feels most like Rails, and it is where many Django newcomers stall.
Choosing the front end. Rails 7.1 ships one default answer for interactive pages: import maps and Hotwire, which updates pages with HTML sent from the server2122. Django ships server rendered templates and leaves the rest to you. The common paths at the end of 2023 are plain templates, templates with htmx (a small library that lets HTML attributes make requests and swap in server responses)23, or Django REST Framework serving JSON to a separate React or Vue application. Each is valid. The difficulty is not any one of them. It is that a newcomer has to choose before they know enough to choose well, and the choice shapes everything after.
Example: Aisling's booking list, and the query she cannot see
Aisling builds the same daily list in Django, function style:
# bookings/views.py
from django.shortcuts import render
from django.utils import timezone
from .models import Booking
def booking_list(request):
today = timezone.localdate()
# lazy: no query runs on this line
bookings = Booking.objects.filter(starts_at__date=today).order_by("starts_at")
return render(request, "bookings/booking_list.html", {"bookings": bookings})
# bookings/urls.py
from django.urls import path
from . import views
app_name = "bookings"
urlpatterns = [
path("", views.booking_list, name="list"),
]
Every name is imported. The template path is written out. The URL is mapped by hand and has a name for reversing. Nothing is hidden, and Aisling likes that.
Her template loops over the bookings and prints {{ booking.customer.name }}. On a busy Saturday the page is slow. She installs a query logger and finds the same N + 1 problem Cian found: one query for the bookings, then one per customer. The query ran in the template, not in the view, because the queryset was lazy and each booking.customer loaded on access. The fix is one call:
bookings = (
Booking.objects.filter(starts_at__date=today)
.select_related("customer") # join the customer in the same query
.order_by("starts_at")
)
Then she rewrites the view as a class, because the codebase uses them:
# bookings/views.py
from django.utils import timezone
from django.views.generic import ListView
from .models import Booking
class BookingListView(ListView):
model = Booking
# template defaults to bookings/booking_list.html
# context gets booking_list (and object_list)
def get_queryset(self):
today = timezone.localdate()
return (
Booking.objects.filter(starts_at__date=today)
.select_related("customer")
.order_by("starts_at")
)
Shorter, and suddenly two things happen that no line states: a template is found by convention and a variable appears in its context. Aisling meets a little of Rails' magic inside Django, at exactly the point Django's documentation warns about.
The hard concepts, side by side
Here are the concepts that take newcomers longest in each framework, as I see them, with what makes each one hard and the documentation that explains it.
| Framework | Concept | Why it is hard | Where it is explained |
|---|---|---|---|
| Rails | Autoloading with Zeitwerk | Names appear without imports, file names must match constants | Rails Guides, Autoloading and Reloading Constants9 |
| Rails | Implicit rendering | The template that renders is not named anywhere | Rails Guides, Layouts and Rendering10 |
| Rails | Attributes and association methods | Methods exist that no file in the app defines | API, ActiveRecord::Base11 |
| Rails | Routes and path helpers | resources creates routes and helpers in one line | Rails Guides, Routing24 |
| Rails | Callbacks | Side effects run far from the line that triggered them | Rails Guides, Active Record Callbacks12 |
| Rails | Concerns | Behaviour is mixed in from a module elsewhere | API, ActiveSupport::Concern13 |
| Django | Project versus app, settings | Abstract on day one, many files before the first page | Django tutorial, part 115 |
| Django | Lazy querysets and lookups | When a query runs is not where it is written | Django docs, Making queries17 |
| Django | select_related and prefetch_related | Two tools for two relationship shapes | Django docs, QuerySet API18 |
| Django | Class based views and mixins | Behaviour spread across a class hierarchy | Django docs, class based views19 |
| Django | Choosing the front end | A design decision forced early | No single official answer |
| Both | N + 1 queries | Loops quietly multiply database calls | Rails querying guide14, Django QuerySet API18 |
| Both | Migrations | Database changes as versioned code | Each framework's migration guide |
Notice the pattern. Rails' hard concepts are mostly "where does this come from". Django's are mostly "which way should I do this" and "when does this happen". Both share the database lessons, because underneath both frameworks it is still SQL.
The ecosystem curve: tests, deployment and the front end
The third curve is the one tutorials skim and real projects live in. It covers the habits around the code.
Tests. Rails ships with Minitest as its default testing library and generates test files with every model and controller25. It also has system tests that drive a real browser. Much of the community uses RSpec instead, so a newcomer meets two styles. Django's built in tests use Python's standard unittest module, with Django's own TestCase running each test inside a transaction26. Many Django teams use pytest with the pytest django plugin instead. Again, two styles. The testing series later in this programme goes through both toolchains in full.
Deployment. New Rails 7.1 applications include a Dockerfile by default21, which makes the path to a container short. Django's deployment guide covers serving the application through WSGI or ASGI, with static files collected separately27. Neither is hard once learned. Both are new to someone who has only ever run a development server.
Packages. Ruby developers manage gems with Bundler and a Gemfile. Python developers manage packages with pip and virtual environments, or with a tool such as Poetry. Aisling already knows pip. Cian knows npm, which helps with the idea but not the details.
The front end. Covered above. For Cian this is the biggest ecosystem question in either framework, because his React experience transfers directly only if the product has a separate React application.
Example: Freewheel's definition of done in week four
Niamh asks, fair enough, what "productive" will mean by the end of the first month. Aisling and Cian agree on a definition, and I would use the same one for any team. A developer is productive when they can take a small feature, for example "a mechanic can mark a job card as ready", and on their own:
- write the migration and the model change,
- write the controller action or view and the template,
- write at least one test that fails first and passes after,
- run the whole suite locally and keep it green,
- open a change that a reviewer accepts without explaining a framework concept to them.
Step 5 is the honest one. Steps 1 to 4 can be done by copying. Step 5 shows whether the developer understood what they copied.
A realistic timeline, as a reasoned estimate
What follows is my estimate, reasoned from the curves above. It is not measured data, and I am not aware of a rigorous study that measures time to productivity in either framework. Use it to plan, then replace it with what you observe.
For a developer who already works professionally in another language:
| Point | Rails | Django |
|---|---|---|
| Week 1 | Builds pages with generators, follows tutorials, ships nothing unaided | Has finished most of the tutorial, understands the wiring, slower output |
| Month 1 | Through or inside the wall, ships small features with help | Ships small features with help, starts meeting query and view questions |
| Month 3 | Ships features alone, can trace most behaviour to its source | Ships features alone, has settled on a view style and front end approach |
| Month 6 | Reviews others' work, knows when to use and avoid callbacks and concerns | Reviews others' work, reads query plans, structures apps cleanly |
For a complete beginner, the timeline stretches, and the order changes. A beginner has to learn programming itself first: variables, functions, loops, how a web request works, what a database is. That alone is a matter of months. Python's larger body of beginner material makes that stage easier to do alone. Rails' first week magic is a double edged gift for a beginner: it produces impressive results before they can tell the framework's work from their own. My estimate for a beginner reaching the month 3 level above is closer to nine to twelve months, in either framework, with a mentor making a far larger difference than the framework choice.
The two lines end in the same place. They differ in shape, and the shape is the point: Rails gives early and asks for it back around the wall, Django gives later and then flattens while the big choices are made.
The learning tax: what the curve costs in a six month budget
A curve is easier to reason about once it has a price. I call the price the learning tax: the developer weeks lost to learning, compared with someone already fluent. If a developer produces 60% of their normal output in a given week, that week carries 0.4 weeks of tax.
Split the six months into phases and add them up. This is a weighted sum, the same idea as an average weighted by time (Foundations: ratios and rates, and the mean for averages):
where is the learning tax in developer weeks, numbers the phases, is the number of weeks in phase , and is the developer's average share of normal output during phase , between 0 and 1.
The share of the budget lost is then a simple ratio (Foundations: ratios and rates):
where is the share of the budget, is the sum of every developer's learning tax, and is the budget in developer weeks.
Example: Freewheel's four combinations
Freewheel's budget is six months for two developers: 26 weeks each, so developer weeks. I use four phases: weeks 1 to 2 (), weeks 3 to 6 (), weeks 7 to 12 () and weeks 13 to 26 (). The productivity shares are my estimates, reasoned from what each developer brings:
| Developer and framework | Weeks 1 to 2 | Weeks 3 to 6 | Weeks 7 to 12 | Weeks 13 to 26 |
|---|---|---|---|---|
| Aisling in Django | 0.55 | 0.70 | 0.80 | 0.90 |
| Aisling in Rails | 0.35 | 0.45 | 0.70 | 0.90 |
| Cian in Django | 0.25 | 0.50 | 0.65 | 0.85 |
| Cian in Rails | 0.30 | 0.40 | 0.70 | 0.85 |
Aisling in Django starts high because Python and Flask transfer. Aisling in Rails dips in weeks 3 to 6, the wall. Cian starts low in Django because both Python and the explicit wiring are new, and starts a little higher in Rails thanks to the generators, then hits the wall.
Aisling in Django:
where each term is for one phase, so developer weeks.
Aisling in Rails:
where the brackets now show already worked out, so developer weeks.
Cian in Django:
where again each bracket is , giving developer weeks.
Cian in Rails:
where the same arithmetic gives developer weeks.
So the team's tax is developer weeks in Django and in Rails. As a share of the budget (Foundations: percentages):
where is the share of Freewheel's 52 developer weeks lost to learning in each framework.
Three things follow, and they are the useful part.
First, the learning tax is large in both: about a quarter of the first six months. Any plan that assumes full speed from week one is wrong before it starts, whichever framework wins.
Second, the difference between the two is about two developer weeks, roughly 4% of the budget. It comes almost entirely from Aisling's Python. That is real, and it is also small next to the five year costs the fifth chapter of this series looks at: upgrades, hiring and maintenance.
Third, timing matters more than the total. Rails' tax is concentrated in weeks 3 to 6, right when Freewheel would be building the booking flow. Django's is spread more evenly, with a flat stretch around the front end decision. A project manager who knows where the dip falls can schedule around it: put the well understood work in the dip, and the risky work after it.
Test the wall, not the honeymoon
Freewheel plans to build a two week spike of the core, booking and the workshop board, in both frameworks before deciding. That is a sound idea with a hidden bias. A two week spike measures the first two weeks. In Rails, those are the honeymoon. In Django, they include the slow start. Left alone, the spike flatters Rails and undersells Django.
The fix is to put one deliberate wall task into each spike: the thing that framework's newcomers find hardest, done on purpose while someone experienced can help.
Example: the wall tasks in Freewheel's spikes
In the Rails spike, Cian and Aisling add a callback that sends the booking confirmation, move the "is this booking in the past" logic into a concern shared by Booking and JobCard, and update the workshop board through a Turbo Stream. Then each of them answers the seven questions from the trace table above, for code the other one wrote, without looking anything up for the first five minutes.
In the Django spike, they rewrite the booking list as a ListView, add a related field and find and fix the N + 1 query with the query log open, and make the workshop board update with htmx. Then each explains, for code the other wrote, which queries a page runs and when.
The spikes now measure how each developer copes with the hard part, which is what the six months will actually be made of. How Freewheel weighs the results is the subject of the sixth chapter, on a decision method.
What to learn first, and what to postpone
Order matters as much as effort. Learning the right thing at the wrong time is how a month disappears.
Learn first, in Rails:
- enough Ruby to read blocks, symbols, hashes and truthiness,
- the request path: route, controller, view,
- Active Record basics and migrations,
- the conventions behind autoloading and implicit rendering, on purpose, in week one rather than discovering them in week four,
- Minitest and one system test.
Postpone in Rails: metaprogramming of your own, writing concerns, Action Cable, complex Stimulus controllers, and any gem that replaces a Rails default. Use the default until you know why you would leave it.
Learn first, in Django:
- Python basics, if needed,
- project, app, settings and URL configuration,
- models, migrations and the admin,
- function based views and templates,
- querysets, laziness and
select_related, - the built in test runner.
Postpone in Django: class based views beyond ListView and DetailView, custom mixins, signals, custom managers, Django REST Framework (unless the product needs an API on day one), and the front end decision beyond plain templates until the first feature works end to end.
Two rules apply to both. Learn the database lessons early, because N + 1 queries and missing indexes hurt in either framework. And learn the testing tool in the first month, because every later week is faster with tests.
Example: Aisling's next step after her first Rails week
At the end of week one in Rails, Aisling can generate a model, write a controller action and render a list. She walks the flow. Can she say where every line on her page gets its behaviour? Not yet: she does not know where edit_booking_path comes from. So she reads the routing guide's section on resources and runs bin/rails routes to see the generated list. The next question: can she see every query? She opens the development log, which in Rails prints each SQL query, and spots the N + 1. She adds includes(:customer). Then tests: she writes a model test for the "is in the past" rule before writing the method. Only then does she touch Hotwire.
A week by week plan for Freewheel
Here is how I would plan Freewheel's first two months, in either framework. It is my suggested plan, not a fixed recipe.
| Week | Both developers | Aisling's focus | Cian's focus |
|---|---|---|---|
| 1 | Official tutorials: the Rails Getting Started guide and the Django tutorial, parts 1 to 4 | Ruby from Python differences, Ruby quickstart | Python tutorial, then Ruby quickstart |
| 2 to 3 | First spike: booking and workshop board, plus its wall tasks | Models and queries | Templates and the live board |
| 4 to 5 | Second spike in the other framework, plus its wall tasks | Swap roles: Aisling on the board | Cian on models and queries |
| 6 | Decision week: compare, score, decide (chapter 6) | ||
| 7 to 8 | Build the real booking flow test first in the chosen framework, with the trace test at the end of week 8 | Booking rules and slot logic | Workshop board and job cards |
The swap in weeks 4 to 5 is deliberate. Each developer should feel both the data side and the interface side of each framework, or the evaluation compares the developers instead of the frameworks.
For books alongside the official material, three are current and fair choices at the end of 2023. Agile Web Development with Rails 7 by Sam Ruby and Dave Thomas, Pragmatic Bookshelf, May 2023, builds a shop through the framework28. Django for Beginners by William S. Vincent, updated for Django 4.2 in 2023, builds several projects and covers testing and deployment29. Python Crash Course, third edition, by Eric Matthes, No Starch Press, December 2022, teaches Python from scratch and ends with a Django project, useful for Cian30. Django 5.0, released on 4 December 2023, changes little a beginner meets in those chapters31. Rails 7.1, released on 5 October 2023, is the version the Rails book's lessons carry straight into32.
How to judge a developer's real level
CVs say "three years of Django" or "Rails expert". Neither tells you whether the person is past the wall. Three short exercises do, and they work in both frameworks.
The trace test. Give the candidate a page of real code they did not write and ask, for each interesting line, where the behaviour comes from. In Rails: the route, the autoloaded constant, the callback, the concern, the helper. In Django: the URL configuration, the view's parent classes, the template lookup, the moment the queryset runs. A developer past the wall answers quickly and says "let me check" for the rest, then knows exactly where to check.
The query test. Show a list page and its development log. Ask how many queries it runs and how to reduce them. This separates people who have built real pages under load from people who have built tutorials.
The "why not the default" question. Ask about one default they would change and one they would never change. In Rails: when they would avoid a callback, or why they would keep Minitest or move to RSpec. In Django: when they would choose a function view over a class, or how they would pick between templates, htmx and a separate front end. Good answers name a trade off. Weak answers name a preference.
Example: the trace test on Cian at the end of the Rails spike
On the last day of the Rails spike, Aisling runs the trace test on Cian with eight lines from the booking code she wrote. Cian answers six straight away. On the seventh, a method on Booking he cannot find, he says it is probably from a concern and checks the include lines at the top of the model: correct. On the eighth he says a confirmation is sent "somewhere in the mailer", which is right but not the question. The question was what triggers it. Aisling points him to the callback. Verdict: past the wall, with one gap to close. The test took 20 minutes and told Niamh more than a week of status updates.
For the person paying for this
If you commission a web application, here is what this chapter means for your budget and your conversations:
- Expect a learning tax of roughly a quarter of the first six months when your developers are new to the framework, in either framework. Ask to see it in the plan. A plan with no dip is optimistic, not efficient.
- The difference between the frameworks on learning is small. In the Freewheel example it was about two developer weeks out of 52. Do not let it decide the framework on its own.
- Ask when the dip falls. In Rails it tends to come in weeks two to six. In Django it tends to come with the early front end and view decisions. Schedule your demos and deadlines with that in mind.
- Ask for the trace test. Whoever builds your application, ask a developer to explain, line by line, where one page's behaviour comes from. If they cannot, they are still paying off the loan with your money.
If you want a second pair of eyes on a plan like this, I run a free workshop where we look at your team, your product and the first six months together. For the kind of applications I build, see web application development.
My view
My view: the honest learning curve is about the same length in Django and Rails for an experienced developer, and it is the shape that differs. Rails gets a newcomer productive sooner and asks for understanding later, at the wall. Django asks for understanding sooner and spends it later on choices. Neither is easier. They are easier at different times.
Three judgements follow, and they are mine, not documented fact. First, language background matters more than framework design: a Python developer starts Django with a real head start, and that head start is worth weeks, not months. Second, for a complete beginner, Python's far larger body of learning material is a genuine advantage, and a mentor is worth more than either framework. Third, most teams evaluate frameworks during the honeymoon. Test the wall on purpose and the comparison becomes fair.
I build on Rails because, for the products I make, the conventions pay back for years after the loan is repaid. That is a reason to choose Rails once you are past the wall. It is not a claim that the wall is lower.
Conclusion
Learning Django or Rails is three curves at once: the language, the framework and the ecosystem. Python is taught far more widely than Ruby, which helps beginners most. Rails front loads the reward and back loads the understanding, so expect the wall between weeks two and six, caused by autoloading, implicit rendering, generated methods, callbacks and concerns. Django front loads the wiring and back loads the choices, so expect a slower first week and harder questions around querysets, class based views and the front end. Both share the database lessons.
Plan for a learning tax of about a quarter of the first six months, put the wall on the schedule, test the wall in any evaluation, and judge developers by whether they can trace behaviour to its source. The framework decision itself belongs to a method, not a learning curve. That is where this series goes next, after a look at what each costs to run, hire for and keep up to date.
