Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django News - Django Girls Turns 10 - Nov 1st 2024
News 2025 DSF Board Candidates There are 21 individuals who have chosen to stand for election, and here is a complete list including their candidate statements. Voting closes on November 15, 2024, at 23:59 Anywhere on Earth. djangoproject.com Django Girls Blog — It's our 10th birthday! Django Girls has turned 10! We’re so proud to reach this momentous milestone and of everything the community has achieved! During the past decade, 2467 volunteers in 109 countries have run 1137 free workshops. More than 24,500 women in 593 cities have attended our events, and for many of them, Django Girls was their first step towards a career in tech. The results speak for themselves. djangogirls.org Octoverse: AI leads Python to top language as the number of global developers surges In this year’s Octoverse report, Python overtook JavaScript as the most popular language on GitHub. github.blog PSF Fellow Nominations Q4 Due Date PSF Fellow nominations for Q4 2024 are open until November 20th—nominate someone whose contributions to the Python community deserve recognition. jonafato.com Updates to Django Today's 'Updates to Django' is presented by Abigail Afi Gbadago from Djangonaut Space! Last week we had 21 pull requests merged into Django by 15 different contributors … -
Python Core Developer - Mariatta Wijaya
Mariatta’s personal site Mariatta on GitHub, Fosstodon, Instagram, and LinkedIn GitHub stories Hidden Figures of Python podcast CMDLines Python discussion forumSponsorThe Stack Report - Carlton's Monthly Premium Newsletter -
Empty Image Fields in Django
tl;dr Django FileFields and ImageFields are stored as strings in your database. Don't use null=True with them, instead use blank=True and filter by .filter(image__exact=""). Discovering a Bug I ran into a bug where I was trying to filter a QuerySet by image__isnull=False to determine if the image field was set. It ended up returning all objects where image was not yet set, so I did some digging. How FileField and ImageField Look in the Database The FileField and ImageField are both implemented in your database table as a varchar field. Note the type column from the psql display table below: Table "public.myapp_mymodel" Column | Type | Collation | Nullable | Default --------------+------------------------+-----------+----------+---------------------------------- id | bigint | | not null | generated by default as identity image | character varying(100) | | not null | This stores the relative path of the file, including your upload_to and filename. The problem is that these strings have two values that might mean "empty": None and "". How to Define a Model with Not Required File Fields I had defined my model like this: class MyModel(models.Model): image = models.ImageField( upload_to="images/", null=True, blank=True, ) But I should have removed the null=True option: class MyModel(models.Model): image … -
2025 Django Software Foundation board nomination
My self-nomination statement for the 2025 Django Software Foundation (DSF) board of directors elections -
Opening Django Model Files in PyMuPDF
I have been working on a file upload feature for a Django project. We use django-storages to store files in AWS S3, but we store them on the filesystem for local development. PyMuPDF is a Python library for reading and writing PDF files. It's very fast and I've been delighted to use it. I ran into a small issue getting my Django file uploads to work with PyMuPDF. This post will outline my notes on how I worked through it. Opening a file from the local filesystem Let's say we have a model SlideDeck with a FileField that stores a PDF file: class SlideDeck(models.Model): pdf = models.FileField( upload_to="slide_decks", max_length="500", ) And a model SlideImage that stores an image for each slide in the PDF: class SlideImage(models.Model): slide_deck = models.ForeignKey( SlideDeck, on_delete=models.CASCADE, ) img = models.ImageField( upload_to="slide_decks/images", max_length="500", ) And we have a helper function to create a list of SlideImage objects from a SlideDeck object: def _create_empty_slides(slide_deck: SlideDeck) -> list[SlideImage]: pdf_document = pymupdf.open(slide_deck.file.path) slide_img_objs = SlideImage.objects.bulk_create( [ SlideImage(slide_deck=slide_deck) for i in range(len(pdf_document)) ] ) pdf_document.close() return slide_img_objs The above works with the Django default FileSystemStorage backend. But if you're using a remote storage backend like the AWS S3 backend from … -
Django News - Last chance to run for the DSF Board - Oct 25th 2024
Django Software Foundation Why you should run for the DSF Board, and my goals for the DSF in 2025 - Jacob Kaplan-Moss Applications are open for the 2025 Django Software Foundation Board of Directors – you can apply until October 25th. So, in this post I’ll do two things: try to convince you to run for the board, and document my goals and priorities for 2025. jacobian.org Steering Council Wishlist for 6.X Thoughts on what the upcoming Steering Council could/should work on. softwarecrafts.co.uk Updates to Django Today 'Updates to Django' is presented by Abigail Afi Gbadago from Djangonaut Space! Last week we had 14 pull requests merged into Django by 12 different contributors - including 3 first-time contributors 👏 Congratulations to YashRaj1506 🚀, Ahmed Ibrahim and Justin Thurman for having their first commits merged into Django - welcome on board! 🚀 Coming in Django 5.2 The new HttpResponse.text property has been added to provide text content for HTTP Responses (no more response.content.decode()!) Overriding password validation error messages is now allowed as opposed to overriding the actual validation method A new autodetector_class attribute has been added to the migration commands Django Newsletter Wagtail CMS Wagtail 6.3a0 (LTS) release notes For the … -
Built with Django Newsletter - 2024 Week 43
Hey, Happy Tuesday! Why are you getting this: *You signed up to receive this newsletter on Built with Django. I promised to send you the latest projects and jobs on the site as well as any other interesting Django content I encountered during the month. If you don't want to receive this newsletter, feel free to unsubscribe anytime. News and Updates Got some inspiration and some time on my hands and built couple of new projects. One of them is the sponsor of today's newsletter (OSIG) and another I will share as soon as I feel like it is launch ready, which should be by the next newsletter issue. As I am developing new products, I am making constant updates to my django-saas-starter template. It is in a good shape right now, but still has some work to do. If you are brave enough to give it a try, I would love to hear your feedback. It is open to the public right now, and I might put it behind the paywall at some point (not soon), ala SaaS Pegasus. I'm trying a new thing. Along side developing new and existing projects, I would like to try purchasing existing profitable … -
Weeknotes (2024 week 43)
Weeknotes (2024 week 43) I had some much needed time off, so this post isn’t that long even though four weeks have passed since the last entry. From webpack to rspack I’ve been really happy with rspack lately. Converting webpack projects to rspack is straightforward since it mostly supports the same configuration, but it’s much much faster since it’s written in Rust. Rewriting things in Rust is a recurring theme, but in this case it really helps a lot. Building the frontend of a larger project of ours consisting of several admin tools and complete frontend implementations for different teaching materials only takes 10 seconds now instead of several minutes. That’s a big and relevant difference. Newcomers should probably still either use rsbuild, Vite or maybe no bundler at all. Vanilla JS and browser support for ES modules is great. That being said, I like cache busting, optimized bundling and far-future expiry headers in production and hot module reloading in development a lot, so learning to work with a frontend bundler is definitely still worth it. Dark mode and light mode I have been switching themes in my preferred a few times per year in the past. The following ugly … -
A Django Blog in 60 Seconds
You can create a full-featured Django blog application in less than sixty seconds. Let's see how, with the help of [neapolitan](https://github.com/carltongibson/neapolitan), a new third-party package from former Django Fellow Carlton … -
Django TemplateYaks
Thursday morning, I fell into a rabbit hole... Inside the hole, there was a yak! I started shaving the yak and only then did I see it was a Django TemplateYak! A tale of a proof of concept for Class-Based Django TemplateTags -
Django News - DSF Weekly Office Hours - Oct 18th 2024
News ➡️ Expression of interest: Django 6.x Steering Council elections The DSF is seeking candidates for the upcoming Django Steering Council 6.x elections—interested individuals can fill out this form to express interest or get feedback on their eligibility. google.com Why Django supports the Open Source Pledge Sentry is one of several partners who have launched the Open Source Pledge, a commitment for member companies to pay OSS maintainers meaningfully for their work. djangoproject.com Python Insider: Python 3.14.0 alpha 1 is now available It's now time for a new alpha of a new version of Python. blogspot.com Django Software Foundation Announcing weekly DSF office hours The Django Software Foundation is opening up weekly office hours, Wednesdays at 6PM UTC, to work on and discuss various DSF initiatives. djangoproject.com 2025 DSF Board Nominations Nominations for the Django Software Foundation are OPEN until October 25th. There have been a host of articles about what the next Board might accomplish to help progress Django. Consider applying! djangoproject.com DSF initiatives I'd like to see Former Django Fellow Carlton Gibson weighs in with his top three initiatives the new Django Software Foundation Board could work on. noumenal.es Updates to Django Today 'Updates to Django' is presented … -
Why you should run for the DSF Board, and my goals for the DSF in 2025
Applications are open for the 2025 Django Software Foundation Board of Directors – you can apply until October 25th. So, in this post I’ll do two things: try to convince you to run for the board, and document my goals and priorities for 2025. -
Epic Debugging, Hilarious Outcome - Building SaaS #205
In this episode, I dug into an issue with sign up. What I thought was going to be a minor issue to fix turned into a massively intense debugging session. We ended up going very deep with the django-allauth package to understand what was going on. -
Epic Debugging, Hilarious Outcome - Building SaaS #205
In this episode, I dug into an issue with sign up. What I thought was going to be a minor issue to fix turned into a massively intense debugging session. We ended up going very deep with the django-allauth package to understand what was going on. -
Managing Django Projects on Your Server with Style
This article is outdated, you’ll find an updated article here. A friend is in the process of setting up a new slice at everbody’s favorite VPS provider Slicehost and asked for some advice. I use MySQL, Nginx & Apache/mod_wsgi on Ubuntu to serve Django. I think Slicehost’s Articles are awesome and a great place to get help you get everything installed and running, so for this article, I’ll focus on some personal preferences regarding directory structure and repo management. One of the biggest difficulties I’ve had to tackle lately is the rapid progress of Django. I have a number of client sites hosted on my slice and have had to freeze them at certain times when backwards incompatible changes come along. My original approach made this really messy, because I only accounted for having one copy of any given third party repo, symlinked from /usr/local/src to my Python site-packages directory. My new approach takes advantage of being able to set your PYTHONPATH at runtime. My directory structure looks like this: |-django |--projects |---domain1.com |---domain2.com |---domain3.com Each site has the following structure: |-domain1.com |--apache |---django.wsgi |--django |--domain1_project |---__init__.py |---app1 |---app2 |---manage.py |---settings.py |---static |---templates |---urls.py |--third_party_repo1 |--third_party_repo2 Just drop domain1.com in … -
Building a Community Site with Django in 40 Hours or Less
All the recent hub bub about 1 week and 1 day application development, motivated me to see how quickly I could launch a website for myself. I, like many developers, struggle with building and releasing personal sites. Ask a web developer and they’re likely to tell you about a couple of sites they started and never finished. Time is always an issue, but the bigger problems are striving for perfection prior to launch and always holding out for that one “killer” feature. As time goes on, interest in the project wanes until it finally gets shelved. The Plan Prior to development, I set a few goals for myself: Launching quickly was priority number one. I set a goal of 3 days. Use as much existing code as possible. Even if it wasn’t a perfect fit, if it was functional, use it. Optimize later. Stop scope/feature creep at all costs. Stay focused. I’m easily sidetracked when working on personal projects. Notice “building a killer website” was not one of the goals. This project was strictly a speed challenge a’la Django Dash. The Idea I wanted to build a site cataloging mountain bike trails complete with full GPS data. I decided not … -
Django Newforms Admin Merged to Trunk
This was a huge feat. Congrats guys! 1.0 here we come. -
Django for Hire
Lincoln Loop has been in “head down” mode for the last couple months. In addition to being knee deep in client projects, we have grown from a one-man development studio to a full-fledged Django development shop/consultancy. We are proud to announce that Lincoln Loop is the first (that we know of) company focusing solely on Django application development. Our development team is currently five strong and oozing with talent. Each member contributes to the community in blog posts or open source add-ons; a few of us have contributed code to Django itself. More on our dev team in the near future. We went through the typical growing pains during the transition, but the kinks are worked out and we can officially say that we are open for business. Django projects big and small, send them our way. Our devs can handle nearly anything. New Django projects based on your specs Existing projects when your developer doesn’t have the time, doesn’t have the expertise or just skipped out on you Scaling up your existing development team for large feature pushes Ellington customization You name it, if it is Django related, we can probably help. Don’t be shy, drop us a line. -
Getting RequestContext in Your Templates
Lately, we’ve been taking over projects from people who began building their first site in Django, but either got in over their head or just found they didn’t have the time to continue. As I review the existing code, the first issue I typically see is using the render_to_response shortcut without including the RequestContext, preventing context processors from being used in the templates. The standard symptom is when people can’t access MEDIA_URL in their templates. Here are a few ways to add RequestContext to your templates. Option #1: Adding RequestContext to render_to_response The Django documentation recommends passing RequestContext as an argument to render_to_response like this: from django.shortcuts import render_to_responsefrom django.template import RequestContextdef my_view(request): # View code here... return render_to_response('my_template.html', my_data_dictionary, context_instance=RequestContext(request)) This works, but as you can see, it adds a fair amount of repetitive code to your views. Option #2: Wrapper for render_to_response Don’t repeat yourself. Create a wrapper like this, courtesy of Django Snippet #3 from django.shortcuts import render_to_responsefrom django.template import RequestContextdef render_response(req, *args, **kwargs): kwargs['context_instance'] = RequestContext(req) return render_to_response(*args, **kwargs) Option #3: Use Generic Views Django’s generic views include RequestContext by default. Although the docs show them being used in urls.py, you can just as easily use … -
On Static Media and Django
We all know not to serve static media (images, CSS, Javascript, etc.) in production directly from Django. Thankfully, Django gives us some nice settings like MEDIA_URL and MEDIA_ROOT to make serving them a lot less painless. Lately, however, I’ve come to realize that these settings shouldn’t really apply to all static media. Not All Static Media Is Created Equal Static media really comes in two flavors. Media that is part of your site like your stylesheets and user generated media or files that are uploaded to the site once it is live. We don’t want to serve all this media from the same place for a couple of reasons: Our source checkouts shouldn’t be crufted up by stuff our users are uploading User generated content and source code should live in two different places on the filesystem We could fix the first problem with some .gitignore, but that doesn’t solve the filesystem issue. Solution: Segregate Your Static Files The answer is to segregate your static files. Django already does this with ADMIN_MEDIA_PREFIX. We use two additional settings in our Django projects, STATIC_URL and STATIC_ROOT. This lets us put user generated content in MEDIA_ROOT outside our project while still serving STATIC_ROOT … -
Serving Django Projects (Revisited)
After reading the comments on my last post on the subject, I realized there was definitely some room for improvement in my strategy. This is take two of the original post. Problems My original strategy had a couple of downfalls: Poisoning the Python Path I was adding directories to the Python Path that weren’t Python. This raised the chance of namespace collision and just wasn’t a very clean way to do things. No project source repository I was still storing all my source files in one big folder. Tracking which project is using what was more difficult than it needed to be. Solutions The first step to recovery was forgetting about sharing libraries between projects altogether. In theory it sounds great, in practice it was cumbersome to manage. My directory structure now looks like this: |-domain1.com |--apache |---django.wsgi |--src |---domain1_project_src |---third_party_repo1 |---third_party_repo2 This is much cleaner and allows for simple control over the versioning on third party repositories. For source with stable <span class="caps">API</span>s, like Django 1.0, I still place it in <tt>/usr/local/src</tt>, allowing me to update all sites using the library in one go without worrying about breakage. Virtualenv is Your New Best Friend As recommended in the comments … -
Introduction to Gondola
Gondola is our content management system built on top of Django. I briefly showed it off during my DjangoCon Lightning Talk, but have been wanting to give it a proper screencast for a while. Here’s an introduction: A few common questions I don’t tackle in the screencast: Is this an open source project? As of right now, no. I do plan on spinning off a few bits as open source over time. In fact, the WYSIWYG editor is already on Google Code as django-admin-uploads. Unfortunately it hasn’t been synced up with our in-house code in a while and isn’t working on 1.0. We’ll get that updated at some point in the near future. How much will it cost? I haven’t settled on a pricing structure yet, but I want it to be affordable for small businesses. What version of Django are you running? 1.0 How’d you add all that stuff to the Django admin interface? It is really quite easy by just overriding a few of the default templates. I hope to write a blog post soon with more details. When can I get my hands on it? Soon. If you have a site you’re interested in putting on it … -
My Lightning Talk from DjangoCon 2008
DjangoCon was an amazing conference all around. I met some great people and learned a lot. I also had the opportunity to get up on stage and present some of the things I’ve been working on here. I was really nervous and after seeing how well prepared the presenters before me were, I had doubts about my plan to go on stage and wing it. I spoke about Trailmapping and Gondola the CMS I’ve been working on. Afterwards, I was blown away by the number of compliments I received. A few people told me they thought my talk was the best of the bunch which was really encouraging. To everyone that reached out, all I can say is thanks; it meant a lot. I’m inspired to carve out some more time to blog about the things I’m working on, specifically Django admin customization and jQuery. Well, it is now on YouTube for all to see. Skip forward to 18:50 if you just want to catch my talk and as I mention in the video, drop me a line or comment here if you’re interested in any of this stuff. Also, Trailmapping got a quick mention (32:22) during James Tauber’s Pinax … -
Simple & Easy Deployment with Fabric and Virtualenv
In the process of prepping Gondola CMS for public consumption, we’ve grown from having a developer (me), to having a development team. One pain point that quickly arose was the amount of time it took for new developers to setup a local development environment. In addition to our source code, the project depends on nearly a dozen other Django apps and Python packages. Initially, we simply tracked the requirements in a text file, but it required a lot of manual work to get them downloaded and installed. Necessity is the Mother of Invention Of course, this problem has been tackled many, many times before1. As I looked into what was out there, my first thought was that most of the existing options were far too complex for our needs. If I didn’t grok a system after clicking around the docs for 10 minutes or so, I moved on. The tool I eventually decided on was Fabric. I was attracted to Fabric, primarily because I found it simple and easy to understand. Unfortunately, I didn’t find a lot of information on using it for local buildouts, so I forged ahead building my own. fab bootstrap Our needs were simple. I wanted … -
Thibaud Colas - 2025 DSF Board Nominations
Thibaud on LinkedIn, on Mastodon Django on Mastodon, on LinkedIn2025 DSF Board NominationsDjango Forum Discussion of 2025 DSF Board ElectionsDSF Individual Members and Steering Council MembersTorchbox CTO and senior dev job offersWagtail high-profile users, newsletter, roadmapSponsorDjango Chat Podcast Sponsorship Information