Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django + Celery & Rabbit - part three
This is a third part of Celery and RabbitMQ in Django series. Today I will be building the Celery and RabbitMQ stack. In previous 2 posts: Django + Celery & RabbitMQ part one and Django + Celery & RabbitMQ part two I have made simple application and played with ffmpeg. First: why we need Celery? Imagine that user upload mp3 file to the application and then in form validation the file is transcoded to other formats. The problem is that user will have to wait for the end of a task. So user sends a request. Then he waits for ffmpeg to transcode uploaded file to different format and then sends the response back. At first glance, it may look correct. But imagine that there are big files to transcode or there is a lot of formats to transcode. The user will have to wait a lot of time. To avoid this I will use celery task with rabbitmq broker to provide transcoding in the background. So what is exactly celery? From the docs: Celery is a simple, flexible and reliable distributed system to process vast amounts of messages, while providing operations with the tools required to maintain such a … -
Django + Celery & Rabbit - part three
This is a third part of Celery and RabbitMQ in Django series. Today I will be building the Celery and RabbitMQ stack. In previous 2 posts: Django + Celery & RabbitMQ part one and Django + Celery & RabbitMQ part two I have made simple application and played with ffmpeg. First: why we need Celery? Imagine that user upload mp3 file to the application and then in form validation the file is transcoded to other formats. The problem is that user will have to wait for the end of a task. So user sends a request. Then he waits for ffmpeg to transcode uploaded file to different format and then sends the response back. At first glance, it may look correct. But imagine that there are big files to transcode or there is a lot of formats to transcode. The user will have to wait a lot of time. To avoid this I will use celery task with rabbitmq broker to provide transcoding in the background. So what is exactly celery? From the docs: Celery is a simple, flexible and reliable distributed system to process vast amounts of messages, while providing operations with the tools required to maintain such a … -
Recommended Django libraries
My two favorite things about Django are Python and the quality of the plugins (which reflects on the quality of Django itself and its community). Here is my personal top 5 of the most useful Django libraries. -
[Django Tips] Make Deleting Easy In Admin!
Lets say we have a model as shown in some project.from django.db import modelsclass Resource(models.Model): """ Model to hold resources for books. """ book = models.ForeignKey('Book') book_type = models.IntegerField() url = models.URLField()This model can be registered in admin as follows.from django.contrib import adminfrom . import modelsclass ResourceAdmin(admin.ModelAdmin): list_display = ('book', 'book_type', 'url')admin.site.register(models.Resource, ResourceAdmin)This will generate a nice admin interface to modify the data.Now if we want to delete a record, we need to follow these steps.First, we have to select that recordNext, we have to click on the action dropdownNext, we have to select delete actionNext, we have to click Go button.In the next page we have to confirm that we have to delete.Just to delete a single record, we have to click 5 times. That's too many clicks for a single action.To simplify the process, we can have simple delete button for the objects as shown. This can be achieved by writing a function which will insert delete button for every record.from django.contrib import adminfrom . import modelsclass ResourceAdmin(admin.ModelAdmin): def delete(self, obj): return '<input type="button" value="Delete" onclick="location.href=\'%s/delete/\'" />'.format(obj.pk) delete.allow_tags = True delete.short_description = 'Delete object' list_display = ('book', 'book_type', 'url', 'delete')admin.site.register(models.Book)Now we have an admin with delete button for the records.To delete an object, just … -
Django Class-Based Views: The Basics
Django Class-Based Views: The Basics -
Django Tips & Tricks #6 - Make Deleting Easy In Admin
Lets say we have a model as shown in some project.from django.db import modelsclass Resource(models.Model): """ Model to hold resources for books. """ book = models.ForeignKey('Book') book_type = models.IntegerField() url = models.URLField()This model can be registered in admin as follows.from django.contrib import adminfrom . import modelsclass ResourceAdmin(admin.ModelAdmin): list_display = ('book', 'book_type', 'url')admin.site.register(models.Resource, ResourceAdmin)This will generate a nice admin interface to modify the data.Now if we want to delete a record, we need to follow these steps.First, we have to select that recordNext, we have to click on the action dropdownNext, we have to select delete actionNext, we have to click Go button.In the next page we have to confirm that we have to delete.Just to delete a single record, we have to click 5 times. That's too many clicks for a single action.To simplify the process, we can have simple delete button for the objects as shown. This can be achieved by writing a function which will insert delete button for every record.from django.contrib import adminfrom . import modelsclass ResourceAdmin(admin.ModelAdmin): def delete(self, obj): return '<input type="button" value="Delete" onclick="location.href=\'%s/delete/\'" />'.format(obj.pk) delete.allow_tags = True delete.short_description = 'Delete object' list_display = ('book', 'book_type', 'url', 'delete')admin.site.register(models.Book)Now we have an admin with delete button for … -
Django Tips & Tricks #6 - Make Deleting Easy In Admin
Lets say we have a model as shown in some project.from django.db import modelsclass Resource(models.Model): """ Model to hold resources for books. """ book = models.ForeignKey('Book') book_type = models.IntegerField() url = models.URLField()This model can be registered in admin as follows.from django.contrib import adminfrom . import modelsclass ResourceAdmin(admin.ModelAdmin): list_display = ('book', 'book_type', 'url')admin.site.register(models.Resource, ResourceAdmin)This will generate a nice admin interface to modify the data.Now if we want to delete a record, we need to follow these steps.First, we have to select that recordNext, we have to click on the action dropdownNext, we have to select delete actionNext, we have to click Go button.In the next page we have to confirm that we have to delete.Just to delete a single record, we have to click 5 times. That's too many clicks for a single action.To simplify the process, we can have simple delete button for the objects as shown. This can be achieved by writing a function which will insert delete button for every record.from django.contrib import adminfrom . import modelsclass ResourceAdmin(admin.ModelAdmin): def delete(self, obj): return '<input type="button" value="Delete" onclick="location.href=\'%s/delete/\'" />'.format(obj.pk) delete.allow_tags = True delete.short_description = 'Delete object' list_display = ('book', 'book_type', 'url', 'delete')admin.site.register(models.Book)Now we have an admin with delete button for … -
Django + Celery & Rabbit - part two
Second part of series about Django application with Celery and RabbitMQ. -
Django + Celery & Rabbit - part two
Hello, today post is the second one in series about Celery in Django. Today I write about ffmpeg. In my application transcoding will be performed by ffmpeg. Why is that? First of all, it's free & open source. So I don't have to pay to use it and I like using the open source tools. Second thing is that ffmpeg is more than enough for my task. It has a lot of features including recording, streaming and transcoding both video and audio. So how to use it? For this project, the ffmpeg needs to be compiled with libmp3lame for mp3 files encoding, libvorbis for ogg format and enabled non-free for ac3. There is guide on ffmpeg site how to compile ffmpeg build. Also, make sure that you have cookies and tea with you while installation can take even 30 minutes. After everything is setup all you need to do is: $ ffmpeg -i mp3_file.mp3 wav_file.wav $ ffmpeg -i mp3_file.mp3 ogg_file.ogg $ ffmpeg -i mp3_file.mp3 ac3_file.ac3 The code above will transcode mp3 files into provided format. In my application one celery task will be called with subprocess, then another celery task will save the output of the first task to django … -
Django + Celery & Rabbit - part two
Hello, today post is the second one in series about Celery in Django. Today I write about ffmpeg. In my application transcoding will be performed by ffmpeg. Why is that? First of all, it's free & open source. So I don't have to pay to use it and I like using the open source tools. Second thing is that ffmpeg is more than enough for my task. It has a lot of features including recording, streaming and transcoding both video and audio. So how to use it? For this project, the ffmpeg needs to be compiled with libmp3lame for mp3 files encoding, libvorbis for ogg format and enabled non-free for ac3. There is guide on ffmpeg site how to compile ffmpeg build. Also, make sure that you have cookies and tea with you while installation can take even 30 minutes. After everything is setup all you need to do is: $ ffmpeg -i mp3_file.mp3 wav_file.wav $ ffmpeg -i mp3_file.mp3 ogg_file.ogg $ ffmpeg -i mp3_file.mp3 ac3_file.ac3 The code above will transcode mp3 files into provided format. In my application one celery task will be called with subprocess, then another celery task will save the output of the first task to django … -
Class Based Views: The Basics
Class Based Views: The Basics -
Parse Inbound Email in Django with SendGrid Inbound Parse
A current 2026 guide to receiving and parsing inbound email in Django with SendGrid's Inbound Parse Webhook — MX setup, the multipart POST fields, raw parsing vs django-anymail, attachments, security and Celery offload. -
Add Sign in with Google to Django (Google OAuth 2.0)
The Google+ APIs were shut down in 2019. Here is the modern, supported way to add Sign in with Google to a Django app using OAuth 2.0 with django-allauth or Authlib. -
How to Index Binary Files (PDF, DOCX) in Django Haystack
Make PDFs, Word and PowerPoint files full-text searchable in Django Haystack. Two proven strategies — Solr + Tika extraction and backend-agnostic Python pre-extraction — with working Haystack 3.x / Django 5.x code, a comparison table, and modern 2026 alternatives. -
Integrating Gitlab in django project with gitlab api to for gitlab authentication and access
This is a simple way to integrate gitlab authentication in your django apps. We can get user verified email id, general information, git lab URL and token from Gitlab API. These Following steps are needed for Gitlab integration: 1. creating git lab app 2. Authenticating user and getting an access token. 3. Get user information, git lab URL using an access token. 1. Creating Gitlab App a. To create an app, Go to your profile and click on applications then create an application on top of a page. Here you can give your application name, redirect URLs then the application will be created. b. Now you can get the client id, secret of an application 2. Authenticating user and getting an access token. a. Here We have to create a GET request for asking user permission. GET "http://{{Your GIT_LAB_DOMAIN }}/oauth/authorize?client_id={{ Your GIT_LAB_APP_ID }} &redirect_uri={{ redirect_uri }}&response_type=code" GIT_LAB_DOMAIN: your git lab domain, GIT_LAB_APP_ID: your application client id, REDIRECT_URI: The URL which … -
Extract Text and Data from PDF and Microsoft Office Files in Python
A practical, up-to-date guide to extracting text and structured data from PDF and Microsoft Office files in Python. Use pdfplumber and pypdf for PDFs, python-docx, openpyxl and python-pptx for Word, Excel and PowerPoint, with OCR fallbacks for scanned documents and a unified approach for RAG and LLM ingestion pipelines. -
Export html web page to pdf using jspdf
Using jsPDF in Django templates to export as PDF jsPDF is used to generate pdf files in client-side Javascript. You can find the links for jsPDF here and also you can find the link to project homepage. You've to include the scripting files/links in head section to work properly. Tip: We have to download the newest version of the library and include it in the HEAD or at the end of the BODY section. Example to run the script from local storage: In the HEAD section: (or) In the BODY section: After loading the scripts in HEAD/BODY section, now we can start using the jsPDF library. Lets start with some of basics of jsPDF to get the idea of using it in our applications: First let us discuss how to create a new document? It's simple as below mentioned: var doc = new jsPDF(orientation, unit, format, compress); The constructor can take several parameters. orientation - The default value of orientation is "portrait". We can set it to "landscape" if we want a different page orientation. unit - We can tell jsPDF in which units we want to work. Use on of the following: "pt" (points), "mm" (default), "cm", "in". format - It's default page format. We … -
Django Custom Template Tags and Filters: A Practical Guide (Django 5.x)
A current, practical guide to writing custom template tags and filters in Django 5.x — templatetags package setup, filters, simple tags, inclusion tags, safe HTML output with format_html, and testing — with copy-paste examples for Django developers. -
Custom Decorators for User Roles & Permissions in Django
A practical, Django 5.x guide to custom view decorators for role- and permission-based access control: functools.wraps, PermissionDenied vs login redirects, a parameterized role_required factory, group_required, stacking with login_required, and when to use the built-ins or DRF permission classes instead. -
How to Customize Django Oscar Models, Views and URLs
Customize Django Oscar the modern way: fork a core app with oscar_fork_app, then override models via AbstractProduct, views via get_class, and URLs via get_urls on the app config (Oscar 3.x / Django 4.2–5.x). -
Django Custom Management Commands (with Examples)
A practical, up-to-date guide to writing custom Django 5.x management commands: the management/commands directory layout, the BaseCommand skeleton, argparse arguments and flags, styled output, CommandError exit codes, a full deactivate-inactive-users example with --dry-run, call_command scheduling, and tests. -
Understanding Django Serializers with Examples
A practical guide to Django REST Framework serializers: Serializer vs ModelSerializer, serialization and deserialization, validation, nested and related fields, and performance, with current Django 5.x and DRF 3.16+ examples. -
Integration of 2Checkout (now Verifone) with Django
2Checkout was acquired by Verifone in 2020 and now runs as 2Checkout (now Verifone). This updated Python 3 guide wires its hosted/inline checkout into Django and confirms every payment server-side through the INS webhook - validating the MD5 signature, storing orders in a model, keeping secrets in environment variables - with an honest 2Checkout vs Stripe vs PayPal comparison. -
LinkedIn API Integration in Python Django (OAuth 2.0 + OIDC)
A modern, 2026-ready guide to integrating the LinkedIn API in Python Django. The old OAuth 1.0a flow, r_basicprofile/r_emailaddress scopes, and the python-linkedin library are gone. Use OAuth 2.0 with Sign In with LinkedIn (OpenID Connect), exchange the code for a token, and read the member profile and verified email from the /v2/userinfo endpoint. -
Mercurial Mirror For Django 1.9 branch
I forgot to mention it, but I’ve created the 1.9 “production” mirror at the usual location: As a reminder, those mirrors have two purposes: be a lightweight read-only repository to clone from for production servers hide the ugly git stuff behind a great mercurial interface The clone is at the usual location at bitbucket, from which […]