Top 102 most downloaded Django packages in 2020
2020 is almost over, and it’s a good time to analyze what the most demanded Django packages in 2020 were.
There are pretty detailed PyPI package repository download statistics available at google cloud. Let’s explore the result of a simple query that collects the total number of downloads for any package with a name containingdjango
.
SELECT file.project, COUNT(*) as total_downloads
FROM `the-psf.pypi.file_downloads`
WHERE DATE(timestamp)
BETWEEN DATE_SUB(CURRENT_DATE(), INTERVAL 360 DAY)
AND CURRENT_DATE()
AND file.project like '%django%'
GROUP BY file.project
ORDER BY total_downloads DESC
LIMIT 100
Download count outperforms some packages that have been in use in the most active projects and doesn’t give the real count of a project’s users. But I think the whole dataset provides a good brief of what was used in 2020. If you know a good library that wasn’t on the list, please note it in the comments. I would be happy to update the article with it!
0. Django
In 2020 Django itself was downloaded over 65.5 million times! An amazingly great boost if you compare it with its 41 million downloads in 2019. Does this mean that Django gained +50% popularity or that CI/CD pipelines have become more widespread in development practice?
1. REST
Half of the Django installations happen in association with the REST Framework. djangorestframework
packages were downloaded over 35 million times. Amazingly, the old, mistypeddjango-rest-framework
package was requested 5 million times,.
The REST Framework forms its own set of the constellation of companion packages, which also ranks among the top of all downloads.
- djangorestframework 34 227 575
- django-cors-headers 17 980 262
- django-rest-framework 5 012 054
- django-rest-swagger 3 834 364
- djangorestframework-jwt 3 663 231
- djangorestframework-simplejwt 3 285 074
- graphene-django 2 447 735
- django-rest-auth 2 238 789
- djangorestframework-camel-case 1 913 461
- djangorestframework-csv 1 819 678
- django-tastypie 1 305 827
- djangorestframework-stubs 973 349
- djangorestframework-filters 902 035
- djangorestframework-xml 891 171
UPDATE: djoser
— authentication packages for the REST Framework has 750208 downloads, a little away from top 100.
2. Development Utilities
Development process helpers is a very popular category of packages. The growing trend toward static typing pushes the type inference django-stubs
package into the TOP 100. It seems, not everyone could upgrade Django to the latest version. In this case, the django-compact
package helps in using new, modern Django features in legacy projects
- django-extensions 16 406 788
- django-debug-toolbar 10 453 779
- pylint-django 5 776 115
- django-waffle 2 239 980
- django-stubs 2 010 553
- django-silk 1 738 951
- django-compat 1 040 285
3. ORM extensions and Form/Serializer fields
This is what we love about Django the most: rich queries and a lot of native DB type support out of the box and with many third-party packages.
Sometimes it’s even hard to choose. What will you use to get tree-structure support — django-treebead
or django-mppt
? How to keep a history of changes — in a single table with django-reversion
or make a separate one for each model with django-simple-history
?
- django-filter 16 706 350
- django-model-utils 5 855 904
- django-timezone-field 5 135 947
- django-import-export 4 059 689
- django-phonenumber-field 3 788 927
- django-mptt 3 530 540
- django-countries 3 395 824
- django-simple-history 2 929 907
- django-taggit 2 500 534
- django-mysql 2 429 771
- django-polymorphic 2 424 916
- django-localflavor 2 395 908
- django-reversion 2 141 762
- django-picklefield 1 998 291
- django-treebeard 1 960 088
- django-dirtyfields 1 752 146
- django-jsonfield 1 382 853
- django-bitfield 1 375 136
- django-bulk-update 1 272 312
- django-modeltranslation 1 093 761
- django-modelcluster 907 941
4. Testing
The recent discussion about embedding pytest-django
into the Django core revealed a lack of several important features. Even still, pytest
is the most popular alternative test runner for Django projects.
- pytest-django 12 145 477
- django-nose 3 378 225
- django-coverage-plugin 1 225 145
5. Forms
Forms are an awesome part of Django that drastically reduce manual HTML coding. But you can’t improve on perfection. Plenty of packages allow for tuning form rendering in Django is in active use in 2020.
- django-crispy-forms 5 130 503
- django-widget-tweaks 2 603 999
- django-formtools 2 348 083
- django-ckeditor 1 720 610
- django-autocomplete-light 1 425 283
- django-bootstrap4 1 121 947
- django-bootstrap3 1 119 687
- django-multiselectfield 1 100 977
- django-tinymce 963 423
6. Cache
Django has perfect Memcache Cache backend integration out of the box, but Redis is still quite popular and could be enabled by one of two different third-party packages.
It doesn’t depend on what you are using for the cache backend: django-cacheops
provides handy QuerySet caching and automatic granular event-driven invalidation shortcuts.
- django-redis 9 400 461
- django-redis-cache 2 083 225
- django-cacheops 1 130 117
7. Settings
We all wish that Django default settings would be more deployment-friendly by default, but it seems only a fraction of Django projects using django-environ
. Is everyone else happy with os.environ.get
or don’t follow the twelve-factor app methodology?
- dj-database-url 7 573 407
- django-appconf 6 783 029
- django-environ 5 588 732
- django-constance 1 159 432
UPDATE: The initial version of this post, missed dj-database-url
package usage.
8. Background jobs
It could be the most important functionality in a lot of Django projects, but it’s hard to estimate the real usage. Recent versions of the Celery
library work out of the box without any additional Django-specific glue. Celery is the most popular distributed task queue in the Python world. It has 35 million downloads.
- django-celery-beat 4 427 330
- django-celery-results 3 308 005
- django-celery 1 492 722
- django-crontab 1 271 395
- django-rq 972 330
UPDATE: Other celery
competitors, are far away by downloads count dramatiq
- 342 536 huey -
330 942
9. Authentication and Authorization
External service integration is the most requested feature in the authentication category. Row-level permissions leader django-guardian
has been on top for many years.
- social-auth-app-django 4 228 917
- django-allauth 3 563 403
- django-oauth-toolkit 2 851 276
- django-otp 1 945 657
- django-guardian 1 797 562
- django-auth-ldap 1 193 910
10. Shortcuts and helpers
Does Django core contain everything for comfortable development? Or are we still missing a couple of handy shortcuts that bring utility packages to the top of the download list?
- django-ipware 4 102 954
- django-braces 2 250 861
- django-user-agents 1 468 511
- django-annoying 867 588
11. Frontend tools
Are you surprised to see the frontend integration category only ranking in 11th place? I am too. Seems most of the projects use native JavaScript tools and don’t bother with Django integration.
- django-js-asset 3 924 030
- django-webpack-loader 3 439 016
- django-compressor 2 969 084
- django-pipeline 1 085 094
12. Security
Django, by default, contains ClickJacking and CSRF attacks protection. Third-party packages provide generic rate-limiting and login attempt restrictions. django-csp
even more, restricts JavaScript execution on the page mitigating the risk of content injection vulnerabilities such as cross-site scripting,
- django-axes 2 071 982
- django-ratelimit 1 341 813
- django-csp 1 339 511
13. Mail
Again, the category of packages that extends Django core functionality with cloud services support. Single Amazon SES service seems as popular as all other transactional mail services together.
- django-ses 1 992 158
- django-anymail 1 858 837
14. Monitoring
Helper tools to improve Django monitoring. We are missing Sentry
here since it is hard to split its usage inside Django projects, but definitely with 42 million downloads over the year, Sentry
is the leader in its own category
- django-health-check 1 933 588
- django-prometheus 1 742 891
- django-log-request-id 1 041 023
15. Administration
Django admin has become better and better over the years. Not so many packages are required to improve it more. But still, styles with a beautiful look and feel keep django-grappelli
on top.
- django-grappelli 1 518 684
- django-admin-rangefilter 1 385 710
- django-admin-sortable2 1 012 336
- django-object-actions 1 015 603
16. Search
The last category — full-text search support. Ever wonder what library to use in companion with ElasticSearch? Me too.
- django-haystack 1 255 008
- django-elasticsearch-dsl 934 495
Other
Those packages that are so good they don’t have any competitors in their category in the TOP 100 downloads.
Keep static and media files in the cloud with django-storages
, render cleaner templates with django-tables2
, django-classy-tags
and django-sekizai
, and organize workflows with django-fsm
.
django-heroku
is the only package in the TOP 100 that helps with Django deployment. Isn’t this task so complex that no other packages are created?
- django-storages 13 080 397
- django-tables2 1 439 101
- django-fsm 1 395 410
- django-classy-tags 1 307 024
- django-heroku 1 193 323
- django-sekizai 1 030 699
Bonus +2
Several packages do not mention Django in their name. Wagtail has twice as many downloads as django-cms
and definitely should be included in the TOP 100
The last version of Django has built-in async support. Does this mean that the popularity of the channels
package would decline?
- channels 3 050 679
- wagtail 1 010 017
That’s all the TOP 100 by download count packages in the Django universe.
Dear Django devs, this is how we’ve spent 2020. Do you have an idea about what’s going to climb to the top in the next year? What packages are we missing? Have there been any new upcoming tools created recently? Post in the comments to get them raises in the article updates.
Happy coding, Merry Christmas and Happy New Year!