django-rest-framework VS Django

Compare django-rest-framework vs Django and see what are their differences.

Our great sponsors
  • Sonar - Write Clean Python Code. Always.
  • Scout APM - Truly a developer’s best friend
  • InfluxDB - Build time-series-based applications quickly and at scale.
  • Zigi - The context switching struggle is real
django-rest-framework Django
160 377
24,521 67,422
1.4% 1.4%
8.5 9.9
4 days ago 3 days ago
Python Python
BSD 3-clause "New" or "Revised" License BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

django-rest-framework

Posts with mentions or reviews of django-rest-framework. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-25.
  • Hide mysql connection from app users
    2 projects | reddit.com/r/learnpython | 25 Nov 2022
  • Why Domain Driven Design?
    2 projects | news.ycombinator.com | 25 Nov 2022
    > Sure you can do DDD in Django. But I do not find that framework inherently CQRS of SOA (not SOA due to it's monolithic nature).

    Django has "apps", which--while they do run in the same process--aren't intended to use code from each other. They're supposed to have their own models/views/templates/migrations/etc. They're effectively different services, as long as you don't think a service has to be available at a different network address to be a different service (think of mounting different apps or microservices behind different URLs, for example).

    Also, I wouldn't say Django is CQRS--CQRS is more or less a different phrasing of "JSON-RPC", which "REST" has become.

    > Last Django app i saw sure had a lot of this boilerplate going. I saw this talk and thought: well this is finally a "framework" that allowes me to do away with serialization (as in: in this framework the amount of extra work you do for making the app an SPA is fairly minimal):

    Eh, some people are highly allergic to any boilerplate, but like, the DRF example [0] has practically none.

    That Elm video is interesting, but I'm skeptical of anything whose central claim is "I can easily turn front end data requests into SQL and back again in very few lines of code". There's just a lot of inherent complexity there, and my evidence is every mainstream ORM, plus all the "backend-as-a-service" products that are multi-1000s LOC. Then again I think SQL is a great (legendary, honestly) language and we should stop trying to replace it.

    [0]: https://www.django-rest-framework.org/#example

  • recommendations for Back End Engineer roadmap?
    2 projects | reddit.com/r/learnprogramming | 11 Nov 2022
  • What are some libraries/crates that Rust still doesn't have readily available?
    2 projects | reddit.com/r/rust | 2 Nov 2022
    +1 for Django. What I'd like to see even more is something that is on-par with Django Rest Framework. This library deals with so much that I had wished that existed in other frameworks in other languages. Viewsets, different parsers, auto-generated API docs, excellent validation guards, authentication and permissions, throttling, filtering, pagination, versioning, many many more, it's just an amazing piece of work.
  • Build Blazing Fast REST Api using Django + Elasticsearch + Haystack
    4 projects | dev.to | 22 Oct 2022
    Django REST Framework
  • De/Serializing JSON In Python, While Keeping Your Types
    3 projects | reddit.com/r/Python | 10 Oct 2022
    have you seen Django REST? https://www.django-rest-framework.org
  • Any alternative to Laravel (PHP) for rapid development?
    4 projects | reddit.com/r/PinoyProgrammer | 26 Sep 2022
    DRF
  • Having issues implementing DjangoModelPermissions on DRF
    4 projects | reddit.com/r/django | 19 Sep 2022
    As you can see, GET return an empty list, later it's used to return a boolean to see if the user has permissions ( you can try to play with the codeCustomDjangoModelPermission only add the proper elt for GET (with a deepcopy to avoid modifying the original DjangoModelPermissions). This modification will return false when django will check if an authenticated user without the view permissions can see the instances of the Tool model.
    4 projects | reddit.com/r/django | 19 Sep 2022
    Interesting, it looks like there is a pull request to fix this, but not merged yet.
    4 projects | reddit.com/r/django | 19 Sep 2022
    Ok, first all thank you for the perfect presentation of your issue and the opportunity to learn something new. After looking at the source code of DjangoModelPermissions, it looks like it's working as expected. An authenticated user has by default GET permissions with DjangoModelPermissions. It's surprising and I think the documentation could be clearer, but it does specify :

Django

Posts with mentions or reviews of Django. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-25.
  • Hide mysql connection from app users
    2 projects | reddit.com/r/learnpython | 25 Nov 2022
  • A minimalist backend REST API in NodeJS
    8 projects | dev.to | 22 Nov 2022
    We deliberately decided not to use "kitchen-sink included" frameworks such as Laravel, Django, Loopback or Nest.js to keep things simple.
  • The Top 4 Python Back-end Web Frameworks for Your Next Project
    2 projects | dev.to | 16 Nov 2022
    Django is the most popular Python web framework for rapid web development. It helps experienced developers save time by allowing them to focus on their website’s content rather than coding from scratch.
  • ¿Qué tecnologías usarían para crear una web app de gestión?
    6 projects | reddit.com/r/programacion | 16 Nov 2022
  • Dockerize an Django Based app along Postgres + Redis + ElasticSearch 🚀
    3 projects | dev.to | 9 Nov 2022
    Django
  • Just Dont
    2 projects | news.ycombinator.com | 8 Nov 2022
    I've been trying to teach myself not to use the word "just" in my documentation.

    I was inspired by this legendary PR to the Django docs that fixed all kinds of words that "minimize difficulty involved": https://github.com/django/django/pull/11482

  • Switching from data analytics to web development
    2 projects | reddit.com/r/cscareerquestionsEU | 8 Nov 2022
    I would suggest you start out with Django, since you already know some python, and try to create some basic CRUD applications. Server-side rendered at first, throw some html/css at the front end, and expand from there. If you need something dynamic, you can try jQuery or alpinejs. After you get somewhat comfortable with those, you can look into single page applications (React, Vue or even frameworks built on top of them - Next, Nuxt, etc.). With those the back end usually is a REST API.
  • The type system is a programmer's best friend
    5 projects | news.ycombinator.com | 5 Nov 2022
    > I don't understand why you're talking about statistical sampling. Aside from random functions, functions are deterministic, unit testing isn't about random sampling. That's not the problem here.

    Completely and utterly incorrect. You are not understanding. Your preconceived notion that unit testing has nothing to do with random sampling is WRONG. Unit Testing IS Random sampling.

    If you want 100% coverage on your unit tests you need to test EVERY POSSIBILITY. You don't. Because every possibility is too much. Instead you test a few possibilities. How you select those few possibilities is "random." You sample a few random possibilities OUT OF a domain. Unit Testing IS random sampling. They are one in the same. That random sample says something about the entire population of possible inputs.

    >Next month some code elsewhere changes and that function ends up getting called with a string containing json instead, so now it blows up in production, you have an outage until someone fixed it. Not great. You might think maybe you were so careful that you actually earlier had unit tests passing a string instead, so maybe it could've been caught before causing an outage. But unlikely.

    Rare. In theory what you write is true. In practice people are careful not to do this; and unit tests mostly prevent this. I can prove it to you. Entire web stacks are written in python without types. That means most of those unit tests were successful. Random Sampling statistically covers most of what you need.

    If it blows up production the fix for python happens in minutes. A seg fault in C++, well that won't happen in minutes. Even locating the offending line, let alone the fix could take days.

    >Following month some code elsewhere ends up pulling a different json library which produces subtly incompatible json objects and one of those gets passed in, again blowing up in production. You definitely didn't have unit tests for this one because two months ago when the code was written you had never heard of this incompatible json library. Another outage, CEO is getting angry.

    Yeah except first off in practice most people tend to not be so stupid as to do this, additionally unit tests will catch this. How do I know? Because companies like yelp have had typeless python as webstacks for years and years and years and this mostly works. C++ isn't used because it's mostly a bigger nightmare.

    There are plenty of companies for years and years have functioned very successfully using python without types. To say that those companies are all wrong is a mistake. Your company is likely doing something wrong... python functions just fine with or without types.

    >And this is one of the 5 arguments, same applies for all of them so there is exponential complexity in attempting to cover every scenario with unit tests. So you can't.

    I think you should think very carefully about what I said. You're not understanding it. Unit testing Works. You know this. It's used in industry, there's a reason why WE use it. But your logic here is implying something false.

    You're implying that because of exponential complexity it's useless to write unit tests. Because you are only covering a fraction of possible inputs (aka domain). But then this doesn't make sense because we both know unit testing works to an extent.

    What you're not getting is WHY it works. It works because it's a statistical sample of all possible inputs. It's like taking a statistical sample of the population of people. A small sample of people says something about the ENTIRE population of people. Just like how a small amount of unit tests Says something about the correctness of the entire population of Possible inputs.

    >This isn't a theoretical example, it's happening in our service very regularly. It was a huge mistake to use python for production code but it's too expensive to change now, at least for now.

    The problem here is there are practical examples of python in production that do work. Entire frameworks have been written in python. Django. You look at your company but blindly ignore the rest of the industry. Explain why this is so popular if it doesn't work: https://www.djangoproject.com/ It literally makes no sense.

    Also if you're so in love with types you can actually use python with type annotations and an external type checker like mypy. These types can be added to your code base without changing your code. Python types with an external checker are actually more powerful then C++ types. It will give you equivalent type safety (with greater flexibility then C++) to a static language if you choose to go this route. I believe both yelp and Instagram decided to do add type annotations and type checking to their code and CI pipeline to grab the additional 10% of safety you get from types.

    But do note, both of those companies handled production python JUST FINE before python type annotations. You'd do well do analyze why your company has so many problems and why yelp and instagram supported a typeless python stack just fine.

  • Rust Web Framework Comparison
    4 projects | news.ycombinator.com | 29 Oct 2022
    GitHub says it's 97.1% python and doesn't list C.

    https://github.com/django/django

  • How do I create a front-end a SQLite database
    2 projects | reddit.com/r/sqlite | 26 Oct 2022
    In that case I'd take a look at Django

What are some alternatives?

When comparing django-rest-framework and Django you can also consider the following projects:

django-ninja - 💨 Fast, Async-ready, Openapi, type hints based framework for building APIs

Nest - A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications on top of TypeScript & JavaScript (ES6, ES7, ES8) 🚀

fastapi - FastAPI framework, high performance, easy to learn, fast to code, ready for production

Flask - The Python micro framework for building web applications.

Masonite - The Modern And Developer Centric Python Web Framework. Be sure to read the documentation and join the Discord channel for questions: https://discord.gg/TwKeFahmPZ

Nuxt.js - The Intuitive Vue(2) Framework

AIOHTTP - Asynchronous HTTP client/server framework for asyncio and Python

django-tastypie - Creating delicious APIs for Django apps since 2010.

Dependency Injector - Dependency injection framework for Python

Tornado - Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

CherryPy - CherryPy is a pythonic, object-oriented HTTP framework. https://cherrypy.dev