Django Awesome Packages
Criterion
- Update frequently less than a year or Irreplaceable
- Frequently use in your django project
Python
jinja: https://github.com/pallets/jinja
pillow
awesome-slugify
fuzzywuzzy
markdown
音视频
moviepy
Video editing with Python
Github: https://github.com/Zulko/moviepy
Doc: https://zulko.github.io/moviepy/
MoviePy depends on the Python modules NumPy, Imageio, Decorator, and Proglog, which will be automatically installed during MoviePy’s installation. The software FFMPEG should be automatically downloaded/installed (by imageio) during your first use of MoviePy (installation will take a few seconds).
1 | pip install moviepy |
Usage
1 | from moviepy.editor import * |
爬虫
requests
beautifulsoup4
html5lib
lxml
文档
Pandoc
Universal markup converter
Github: https://github.com/jgm/pandoc/
下载: https://github.com/jgm/pandoc/releases
使用方法示例:
1 | pandoc demo.md -o demo.docx |
插件:
1 | pip install pandoc-fignos |
pandoc-fignos:https://github.com/tomduck/pandoc-fignos
A pandoc filter for numbering figures and figure references.
处理图形的交叉引用
xhtml2pdf
xhtml2pdf is a HTML to PDF converter using Python, the ReportLab Toolkit, html5lib and PyPDF2. It supports HTML5 and CSS 2.1 (and some of CSS 3). It is completely written in pure Python, so it is platform independent.
Github: https://github.com/xhtml2pdf/xhtml2pdf
1 | pip install xhtml2pdf |
WeasyPrint
The awesome document factory
官网
Github:https://github.com/Kozea/WeasyPrint
Documentation: https://weasyprint.readthedocs.io
Examples: https://weasyprint.org/samples/
1 | pip install weasyprint |
出现错误:
1 | OSError: no library called "cairo" was found |
Win用户此时需要安装GTK3: https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer,并加入环境变量。
测试
单元测试 - 针对程序中最小的功能模块(函数和方法)的测试
测试方法:
- 白盒测试:程序自己写的测试
- 黑盒测试:测试人员或QA,不知道代码实现细节,只关注功能
编写Python单元测试 - 定义类继承TestCase,写测试方法(test_开头)
nose2
1 | pip install nose2 cov-core |
pytest
1 | pip install pytest pytest-cov |
Django
The Web framework for perfectionists with deadlines.
Website:
Auth
django-allauth
Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://github.com/pennersr/django-allauth
1 | pip install django-allauth |
Doc: https://django-allauth.readthedocs.io/en/latest/
Tips: MakeMigration Error on Django - ImportError: cannot import name ‘FieldDoesNotExist’ from ‘django.db.models’ Update your django-allauth:
1 pip install --upgrade django-allauth
social-app-django
https://github.com/python-social-auth/social-app-django
1 | $ pip install social-auth-app-django |
Python Social Auth是一个提供第三方认证登录的模块。使用这个模块可以让用户以第三方网站的信息进行登录,而无需先注册本网站的用户。
Project documentation is available at http://python-social-auth.readthedocs.org/.
1 | INSTALLED_APPS = [ |
django-registration
An extensible user-registration app for Django.
https://github.com/ubernostrum/django-registration
1 | pip install django-registration |
Doc: https://django-registration.readthedocs.io/en/latest/
django-simple-captcha
Django Simple Captcha is an extremely simple, yet highly customizable Django application to add captcha images to any Django form.
Github: https://github.com/mbi/django-simple-captcha
Doc: http://django-simple-captcha.readthedocs.io/en/latest/
Editor
markdown
django-markdown-editor
Once you have pip, type:
1 | $ pip install martor |
Markdown Editor plugin for Django (great to use outside default django admin)

Github: https://github.com/agusmakmun/django-markdown-editor
Demo: https://python.web.id/posts/create/
Markdownx
Comprehensive Markdown plugin built for Django

Github: https://neutronx.github.io/django-markdownx/
django-summernote
1 | pip install django-summernote |
Github: https://github.com/summernote/django-summernote
Summernote is a simple WYSIWYG editor.
django-summernote allows you to embed Summernote into Django very handy. Support admin mixins and widgets.
django-ckeditor
1 | pip install django-ckeditor |
Django admin CKEditor integration.
Github: https://github.com/django-ckeditor/django-ckeditor
Fields & Forms & Templates
django-taggit
https://github.com/jazzband/django-taggit
django-taggit a simpler approach to tagging with Django.
Doc: https://django-taggit.readthedocs.io/en/latest/
django-taggit a simpler approach to tagging with Django. Add "taggit" to your INSTALLED_APPS then just add a TaggableManager to your model and go:
1 | from django.db import models |
Then you can use the API like so:
1 | apple = Food.objects.create(name="apple") |
Tags will show up for you automatically in forms and the admin.
To further more, in views.py:
1 | from taggit.models import Tag |
1 | path('tag/<slug:tag_slug>/', views.food_list, name='food_list_by_tag'), |
1 | <!-- <p class="tags">Tags: {{ food.tags.all|join:", " }}</p> --> |
django-model-utils
Django model mixins and utilities.
Github: https://github.com/jazzband/django-model-utils
django-upload-multiple-files
Github: https://github.com/kdchang/python-django-upload-multiple-files
django-versatileimagefield
Github: https://github.com/respondcreate/django-versatileimagefield
A drop-in replacement for django’s ImageField that provides a flexible, intuitive and easily-extensible interface for quickly creating new images from the one assigned to the field.
Doc: https://django-versatileimagefield.readthedocs.io/
django-crispy-forms
The best way to have DRY Django forms. The app provides a tag and filter that lets you quickly render forms in a div format while providing an enormous amount of capability to configure and control the rendered HTML.
Github: https://github.com/django-crispy-forms/django-crispy-forms
django-widget-tweaks
Tweak the form field rendering in templates, not in python-level form definitions. CSS classes and HTML attributes can be altered.
Github: https://github.com/jazzband/django-widget-tweaks
1 | {% load widget_tweaks %} |
django-imagekit
pillow
Automated image processing for Django. Currently v4.0
Github: https://github.com/matthewwithanm/django-imagekit
1 | from django.db import models |
sorl-thumbnail
Thumbnails for Django
Getting the code for the latest stable release use ‘pip’.
1 | $ pip install sorl-thumbnail |
Github: https://github.com/jazzband/sorl-thumbnail
Doc: https://sorl-thumbnail.readthedocs.io/en/latest/
1 | INSTALLED_APPS = [ |
1 | {% load thumbnail %} |
Admin Ehancement
django-autocomplete-light
https://github.com/yourlabs/django-autocomplete-light
A fresh approach to autocomplete implementations, specially for Django. Status: v3 stable, 2.x.x stable, 1.x.x deprecated. Please DO regularely ping us with your link at #yourlabs IRC channel
Doc: https://django-autocomplete-light.readthedocs.io/
django-analytical
https://github.com/jazzband/django-analytical
The django-analytical application integrates analytics services into a Django project.
Admin
simpleui
Github: https://github.com/newpanjing/simpleui
A modern theme based on vue+element-ui for django admin.
django-fluent-pages
A smooth, flexible CMS to create the designs you like,built on top of the powerful Django framework.
Features:
- A fully customizable page hierarchy.
- Support for multilingual websites.
- Support for multiple websites in a single database.
- Fast SEO-friendly page URLs.
- SEO optimized (meta keywords, description, title, 301-redirects, sitemaps integration).
- Plugin support for custom page types, which:
Github: https://github.com/django-fluent/django-fluent-pages
1 | pip install django-fluent-pages |
https://github.com/un1t/django-file-resubmit
django-suit
Github: https://github.com/darklow/django-suit
Modern theme for Django admin interface.
V2 demo: https://v2.djangosuit.com/admin/login/?next=/admin/
Django-jet
Framework
djangorestframework
Django REST framework is a powerful and flexible toolkit for building Web APIs.
Github: https://github.com/encode/django-rest-framework
https://www.django-rest-framework.org/
For Taggit:
Wagtail
Wagtail is an open source content management system built on Django, with a strong community and commercial support. It’s focused on user experience, and offers precise control for designers and developers.
https://github.com/wagtail/wagtail
-
A Django blog app implemented in Wagtail :https://github.com/APSL/puput
Saleor
Customer-centric e-commerce on a modern stack
A headless, GraphQL-first e-commerce platform delivering ultra-fast, dynamic, personalized shopping experiences. Beautiful online stores, anywhere, on any device.
https://github.com/mirumee/saleor
Search & Filter
django-haystack
Haystack provides modular search for Django. It features a unified, familiar API that allows you to plug in different search backends (such as Solr, Elasticsearch, Whoosh, Xapian, etc.) without having to modify your code.
Github: https://github.com/django-haystack/django-haystack
django-filter
A generic system for filtering Django QuerySets based on user selections
1 | pip install django-filter |
Github: https://github.com/carltongibson/django-filter
1 | INSTALLED_APPS = [ |
1 | import django_filters |
1 | from django_filters import rest_framework as filters |
django-url-filter
Django URL Filter provides a safe way to filter data via human-friendly URLs.
Easiest way to install this library is by using pip:
1 | $ pip install django-url-filter |
Github: https://github.com/miki725/django-url-filter
Doc: https://django-url-filter.readthedocs.io/en/latest/
To make example short, it demonstrates Django URL Filter integration with Django REST Framework but it can be used without DRF (see below).
1 | from url_filter.integrations.drf import DjangoFilterBackend |
Alternatively filterset can be manually created and used directly to filter querysets:
1 | from django.http import QueryDict |
I18n
django-rosetta
1 | pip install django-rosetta |
Rosetta is a Django application that eases the translation process of your Django projects
Github: https://github.com/mbi/django-rosetta
Doc: https://django-rosetta.readthedocs.io/
django-parler
Easily translate “cheese omelet” into “omelette au fromage”.
The package can be installed using:
1 | pip install django-parler |
Github: https://github.com/django-parler/django-parler
Doc: https://django-parler.readthedocs.io/en/stable/
1 | INSTALLED_APPS += ( |
django-modeltranslation
ranslates Django models using a registration approach.
Github: Thttps://github.com/deschler/django-modeltranslation
Doc: https://django-modeltranslation.readthedocs.org/en/latest
django-autotranslate
A simple Django app to automatically translate the pot (.po) files generated by django’s makemessages command using google translate.
Github: https://github.com/ankitpopli1891/django-autotranslate
Doc: https://ankitpopli1891.github.io/django-autotranslate/
1 | pip install django-autotranslate |
Add 'autotranslate' to your INSTALLED_APPS setting.
1 | INSTALLED_APPS = ( |
1 | python manage.py translate_messages |
1 | # default: 'autotranslate.services.GoSlateTranslatorService' |
Conf
django-hosts
https://github.com/jazzband/django-hosts
1 | pip install django-hosts |
You can find the full docs here: django-hosts.rtfd.org
Dynamic and static host resolving for Django. Maps hostnames to URLconfs.
For example, if you own example.com but want to serve specific content at api.example.com and beta.example.com, add the following to a hosts.py file:
1 | from django_hosts import patterns, host |
django-debug-toolbar
Github: https://github.com/jazzband/django-debug-toolbar
A configurable set of panels that display various debug information about the current request/response.
Doc: https://django-debug-toolbar.readthedocs.io/.
django-appconf
A helper class for handling configuration defaults of packaged Django apps gracefully.
GIthub: https://github.com/django-compressor/django-appconf
Doc: https://django-appconf.readthedocs.io/
django-redis
Full featured redis cache backend for Django.
Github: https://github.com/jazzband/django-redis
Install with pip:
1 | $ python -m pip install django-redis |
Configure as cache backend
To start using django-redis, you should change your Django cache settings to something like:
1 | CACHES = { |
Projects
cookiecutter-django
Github: https://github.com/pydanny/cookiecutter-django
Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
- Documentation: https://cookiecutter-django.readthedocs.io/en/latest/
First, get Cookiecutter. Trust me, it’s awesome:
1 | $ pip install "cookiecutter>=1.7.0" |
Now run it against this repo:
1 | $ cookiecutter https://github.com/pydanny/cookiecutter-django |
Chatbot_CN]
Github: https://github.com/charlesXu86/Chatbot_CN
Chatbot_CN 是一个基于第三代对话系统的多轮对话机器人项目,旨在于开发一个结合规则系统、深度学习、强化学习、知识图谱、多轮对话策略管理的 聊天机器人,目前随着时间的慢慢发展,从最初的一个 Chatbot_CN 项目,发展成了一个 Chatbot_* 的多个项目。目前已经包含了在多轮任务型对话的场景中,基于话术(Story)、知识图谱(K-G)、端到端对话(E2E)。目的是为了实现一个可以快速切换场景、对话灵活的任务型机器人。 同时,Chatbot_CN 不仅仅是一个对话系统,而是一套针对客服场景下的完整人工智能解决方案。对话是解决方案的核心和最重要一环,但不仅限于对话,还包括智能决策,智能调度,智能预测,智能推荐等
django-wiki
A wiki system with complex functionality for simple integration and a superb interface. Store your knowledge with style: Use django models.
django_quiz
This is a configurable quiz app for Django.
Here is an example website
Scrapyd-Django-Template
Basic setup to run ScrapyD + Django and save it in Django Models. You can be up and running in just a few minutes
Img2VecCosSim-Django-Pytorch
Extract a feature vector for any image and find the cosine similarity for comparison using Pytorch. I have used ResNet-18 to extract the feature vector of images. Finally a Django app is developed to input two images and to find the cosine similarity.
vermouth
A torrent site written in the python language & douban scraper
Outdated
- https://github.com/Pierre-Sassoulas/django-hreflang on 27 Mar 2018
- https://github.com/jamespacileo/django-pure-pagination on 27 Dec 2015
Resources
Github Django Resources:
- https://www.djangoproject.com/
- https://github.com/django/django
- https://github.com/jazzband
- https://jazzband.co/
- https://github.com/justdjango
Python:
- Awesome Python:https://github.com/vinta/awesome-python
- Awesome Python(Chinese):https://github.com/jobbole/awesome-python-cn
Books:
-
Agiliq(Webapp and API development with Python, Django and more): https://www.agiliq.com/
Website:
-
Penjee: https://penjee.com/
Penjee is a place where you can learn how to code with the python language. Start right away with our tutorial!






