Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django News - 206 Partial Content - Django Sprints Proposal - Nov 17th 2023
News Paolo Melchiorre - My Django active developers Sprints proposal 🌅 The story of how the proposal to organize sprints on the Django active developers was born and how I proposed it during the past DjangoCon US 2022 in San Diego to various components of the Django community. paulox.net PyPI has completed its first security audit The results of PyPI's very first external security audit. The first post in a three-part series. pypi.org Updates to Django Last week we had 6 pull requests merged into Django by 6 different contributors - including 1 first time contributor! Congratulations to Prakhar Parashari for having their first commit merged into Django - welcome on board! The main priority is resolving release blockers for Django 5.0, as the release candidate is planned for November 20th! DjangoCon Africa was also last week and it looked AMAZING! Congratulations to the incredible folks who make such a wonderful conference. "Django is not a framework, it's a community" 💯💜 Django Newsletter Wagtail CMS Wagtail 5.2.1 Wagtail 5.2.1 is a bugfix release that addresses over a dozen fixes. github.com Looking for sponsorship – Accessibility checks for site administrators We’re building state-of-the-art accessibility checks within the CMS, replacing expensive monitoring … -
A Battle of Async Titans: Django ORM Async vs. SQLAlchemy Async
When you enter the world of Python, you will hear that many developers love Django ORM, and others love SQLAlchemy. Each of those groups will tell you to your face why you have to choose their loved library, and if we add the async part of the programming, they will brag about the capacity of […] The post A Battle of Async Titans: Django ORM Async vs. SQLAlchemy Async appeared first on Distillery. -
A Battle of Async Titans: Django ORM Async vs. SQLAlchemy Async
When you enter the world of Python, you will hear that many developers love Django ORM, and others love SQLAlchemy. Each of those groups will tell you to your face why you have to choose their loved library, and if we add the async part of the programming, they will brag about the capacity of […] The post A Battle of Async Titans: Django ORM Async vs. SQLAlchemy Async appeared first on Distillery. -
How to Build Trust
What are the major management behaviors that can help build trust? Management books often cover the importance of trust, but abstractly. There’s precious little writing about the nuts and bolts, the day-to-day tasks of trust-building. That’s the gap I’d like to try to fill with this article. -
Does someone need to be a good manager to give good management advice?
In a management Slack I’m in, someone responded to a list of commonly-recommended management books by asking, “are these people good managers though?” It’s a fair question! But it’s not quite so simple. -
Parse Inbound Email - Building SaaS with Python and Django #175
In this episode, we switched to the inbound side and parsed an email to transform it into a journal entry. This caused us to look into the dateutil library and look at Python’s standard email module to use EmailMessage. -
Amersfoort (NL) python meetup
The first "pyutrecht" meetup in Amersfoort in the Netherlands. (Amersfoort is not the city of Utrecht, but it is in the similarly named province of Utrecht). I gave a talk myself about being more of a proper programmer to your own laptop setup. Have a git repo with a README explaining which programs you installed. An install script or makefile for installing certain tools. "Dotfiles" for storing your config in git. Etc. I haven't made a summary of my own talk. Here are the other three: An introduction to web scraping - William Lacerda William works at deliverect, the host of the meeting. Webscraping means extracting data from a website and parsing it into a more useful format. Like translating a list of restaurants on a There's a difference with web crawling: that is following links and trying to download all the pages on a website. Important: robots.txt. As a crawler or scraper you're supposed to read it as it tells you which user agents are allowed and which areas of the website are off-limits (or not useful). Another useful file that is often available: /sitemap.xml. A list of URLs in the site that the site thinks are useful for … -
Why is Django's (Unofficial) Mascot a Pony?
Officially, the [Django logo](https://www.djangoproject.com/community/logos/) is a text-only combination of green and white. But unofficially, the Django mascot is … -
Django-related Deals for Black Friday and Cyber Monday 2023
Here are some Django-related deals for this year’s Black Friday (24th Nov) and Cyber Monday (27th Nov), including my own. I’ll keep updating this post as I learn about more deals. If you are also a creator, email me with details of your offer and I’ll add it here. My books My three books have a 50% discount, for both individual and team licenses, until the end of Cyber Monday (27th Nov). This deal stacks with the purchasing power parity discount for those in lower-income countries. Buy now: Boost Your Django DX - $19.50 instead of $39 Boost Your Git DX - $19.50 instead of $39 (released in October!) Speed Up Your Django Tests - $24.50 instead of $49 Aidas Bendoraitis’ GDPR Cookie Consent Package Aidas Bendoraitis of djangotricks.com created this paid third-party app for Django. The package takes the pain out of setting up and customizing legally mandated GDPR Cookie Consent screens. Compared to commercial “one size fits all” solutions, it’s much simpler to use this third-party app to host and tweak your project’s cookie consent screen. Use the discount code BLACKFRIDAY2023 for 20% off, from €150 to €120, until the end of November. Buy it on Gumroad Michael … -
Django News - 205 Reset Content - Nov 10th 2023
News Python Developers Survey 2023 The annual Python developers survey is out. Please take a moment to share your Python practices as the results do have a big impact on the organizations and maintainers in our community. alchemer.com Takahē: Life-Critical Side Projects Andrew Godwin, the developer of Takahē, is looking for new maintainers who want to help out in exchange for mentorship. aeracode.org Updates to Django Last week we had 14 pull requests merged into Django by 9 different contributors - including 2 first time contributors! Congratulations to chenow and Patrick Rauscher for having their first commit merged into Django - welcome on board! Some interesting things from last week... Django 5.1 increased support for window frames. Specifically, RowRange and ValueRange now accept an exclusion argument. We had some security releases issued: 4.2.7, 4.1.13, and 3.2.23 There was an interesting forum discussion around updating the DEP process. Do you speak Português or हिंदी? We will soon have a translation string freeze for the 5.0 release, so this is a good time to join a translation team! You can see the languages Django supports on transifex as well as the ones missing translations. Perhaps you can help translate Django and make … -
aiGrunn: thinking outside the chat box - JP van Oosten
(One of my summaries of the 2023 Dutch aiGrunn AI conference in Groningen, NL). Getting chatgpt to output valid json can be a chore: > extract xxxx, output as json > extract xxxx, output as json list > extract xxxx, output as json with this schema > extract xxxx, output as json, aargh JSON I BEG YOU Apparently they solved the json problem last monday. But he had the same problem when trying to get chatgpt to output only English and not Dutch. So the underlying problem is still there: you have to beg it to output in a certain way and hope it listens. Some other problems are hallucinations: chatgpt telling you something with complete confidence, even though being wrong. And biases. And it is not really a chatbot, as it doesn't ask questions. Unparseable output. Lack of explainability. Privacy issues as you're sending data to servers in the USA. And... what are the data sources chatgpt used? We don't know. They're called "openAI", but they're definitively not open. When to use LLMs and when not to use them. Some good use cases: Zero/few shot learning. A quick way to get a simple minimum viable product or proof of … -
aiGrunn: fighting cancer with AI - Hylke Donker
(One of my summaries of the 2023 Dutch aiGrunn AI conference in Groningen, NL). What is cancer? According to wikipedia: abnormal cell growth with the potential to invade or spread to other parts of the body. That is what you can observe. Medically, there are several aspects of cancer: It prevents the cell from dying. It can grab more than usual resources. No sensitivity to the regular anti-growth signals. Etc. AI starts getting used in clinics. For instance for proton therapy: where to best apply the proton radiation. And in radiology: letting AI look at images to detect cancer. A good AI can out-perform doctors. Analysis of blood samples, trying to detect cancer based on the DNA samples in there. DNA mutations can also be detected, which is what he focuses on. Cancer is basically a "desease of the genome". DNA is made up of T, C, G and A sequences. Technically, it is perfectly feasable to "read" DNA. How do mutations occur? Exposure can leave "scars" in DNA. Damage can occur due to sunlight or smoking for instance. Specific sources result in specific kinds of damage: smoking has a "preference" for changing specific letters. With analysis, you can thus … -
aiGrunn: learntail, turn anything into a quiz using AI - Arjan Egges
(One of my summaries of the 2023 Dutch aiGrunn AI conference in Groningen, NL). Arjan is known for his programming videos. Alternative title: "the dark side of integrating a LLM (large language model) in your software". You run into several challenges. He illustrates it with https://www.learntail.com/ , something he helped build. It creates quizes from text to make the reader more active. What he used was the python library langchain to connect his app with a LLM. A handy trick: you can have it send extra format instructions to chatgpt based on a pydantic model. If it works, it works. But if you don't get proper json back, it crashes. Some more challenges: There is a limit on prompt length. If it gets too long, the LLM won't fully understand it anymore and ignore some of the instructions. A LLM is no human being. So "hard" or "easy" don't mean anything. You have to be more machine-explicit, like "quiz without jargon". The longest answer it provides is often the correct one. Because the data it has been trained on often has the longest one as the correct answer... Limits are hard to predict. The token limit is input + output, … -
aiGrunn: small and practical AI models for CO2 reduction in buildings - Bram de Wit
(One of my summaries of the 2023 Dutch aiGrunn AI conference in Groningen, NL). LLM models can be huge. Mind-boggling huge. But... we can also have fun with small models. He works a company that regulates climate installations in buildings (HVAC, heating, ventilation, air conditioning) via the cloud. Buildings use 30% of all energy worldwide. So improving how the HVAC installation is used has a big impact. A use case: normally you pre-heat rooms so that it is comfy when you arrive. But sometimes the sun quickly warms the room anyway shortly afterwards. Can you not conserve some energy without sacrificing too much comfort? You could calculate an optimal solution, but "just" measuring every individual room in combination with an AI. Technical setup: An "edge device" inside the building. An external API. The API stores the data in mysql (the room metadata) and influxdb (the timeseries). A user selects a room and a machine learning model type and a training data set (from historical data). The software creates a dataset from influxdb, trains the model (pytorch). The trained neural network goes to ONNX (open neural network exchange). The output is stored in minio (S3-compatible object store). Note: all this is … -
aiGrunn: be a better developer with AI - Henry Bol
(One of my summaries of the 2023 Dutch aiGrunn AI conference in Groningen, NL). "Everybody" uses stackoverflow. Now lots of people use chatgpt (or chatgpt plus). Stackoverflow traffic has dropped by 50% in the last 1.5 year. So chatgpt can be your coding buddy. He really likes it for quickly getting something working (MVP). Like writing something that talks to a magento API (a webshop system). It would take him ages to figure it all out. Or he could ask chatgpt. He also thinks you don't need docstrings anymore: you can just ask chatgpt to explain a snippet of code for you. (Something I myself don't agree with, btw). (He demoed some chatgpt code generation of a sample website). What he learned: Good briefing and interaction is key. First tell it what you want before you start to code. Chatgpt sometimes loses track if the interaction goes on for too long. Read what it gives you, otherwise you won't know what it build for you. Watch out for the "cut-off time" of the chatgpt training set: perhaps newer versions of libraries don't work anymore with the generated code. Some dangers: You get lazy. You can get frustrated if you don't … -
Django: Maybe disable PostgreSQL’s JIT to speed up many-joined queries
Here’s a write-up of an optimization I made in my client Silvr’s project. I ended up disabling a PostgreSQL feature called the JIT (Just-In-Time) compiler which was taking a long time for little benefit. This behaviour was observed on PostgreSQL 14, so things may have improved since. Although the version 15 and 16 release notes don’t seem to contain any relevant-looking changes. Okay, story time… I was looking at the project’s slowest tests and found one that took five seconds despite containing few lines of code. Profiling the test revealed a single slow query, which was also slow in production. I grabbed the query plan and fed it to pgMustard using the technique I previously blogged about): pgMustard reported that JIT compilation of the query was taking 99.7% of the 3217ms runtime. The five-star rating for this finding meant that it was ripe for optimization. But why was JIT compilation taking so long? The query used InheritanceManager from django-model-utils, which extends Django’s multi-table inheritance to return heterogenous subclasses of a base model: >>> Place.objects.select_subclasses() [<Library: Downtown Books>, <BookShop: Giovanni’s>] The generated query joins all subclasses’ tables. With many subclasses, that query has many joins. But each join only adds a … -
Contributing to Django - Sarah Boyce
Sarah Boyce on GitHub Django Triage & Review TeamDjangonaut.Space PyDev of the Week: Sarah Boyce Django Discord Channel Support the ShowLearnDjango.comButtonDjango News newsletter -
Database generated columns ⁽¹⁾: Django & SQLite
An introduction to database generated columns, using SQLite and the new GeneratedField added in Django 5.0. -
How to Kill the Django Development Server Without Ctrl+C
Let's say you're developing a Django project and you've lost track of the terminal window that ran your python manage.py runserver command. If you can't press Ctrl+C in the terminal, how do you stop the server? Finding the runserver Process First, we need to find the ID of the manage.py runserver process. On Linux, you can list all processes with the following command: ps aux To search the results, you can pipe the output of that command into the grep command: ps aux | grep manage.py If you want to search multiple words, enclose them in single quotes ' or double quotes ": ps aux | grep 'manage.py runserver' This should give you rows of table data such as: lance 12839 0.0 0.1 57068 49840 pts/25 S+ 07:11 0:00 python manage.py runserver lance 12840 23.0 0.2 435156 67752 pts/25 Sl+ 07:11 4:40 /home/lance/django-workout/.venv/bin/python manage.py runserver lance 23752 0.0 0.0 4040 1980 pts/30 S+ 07:31 0:00 grep --color=auto manage.py runserver This can be confusing because there are a few numbers here and I'm not sure what each number represents. To prepend a row of headers, we can run two commands back-to-back: ps aux | head --lines=1 && ps aux | grep … -
Adding Full Text Search to Your Django App with django-watson
Learn how to supercharge your Django app with full-text search using Django-Watson. Dive deep into Postgres magic and boost search functionality. -
Django News - 204 No Content - Django 4.2.7, 4.1.13, and 3.2.23 Security Release - Nov 3rd 2023
News Django security releases issued: 4.2.7, 4.1.13, and 3.2.23 A new security release for a potential denial of service vulnerability in UsernameField on Windows. As ever, the best security practice is to keep your Django version up to date with the latest release. djangoproject.com Python Software Foundation News: Announcing our new Community Communications Manager! The PSF's first Communications Manager will establish a PSF communications calendar, including annual messaging, newsletters, and blog posts. She will also partner with our Executive Director, Deb Nicholson, and other staffers to enhance our support for the Python community with various initiatives. blogspot.com Updates to Django Last week we had another massive 18 pull requests merged into Django by 13 different contributors - including 4 first time contributors! Congratulations to ksg, Leo Suarez, Izzy Hyman and CheesyPhoenix for having their first commit merged into Django - welcome on board! The System check framework docs now has a new section on writing integration tests: System check framework - Writing integration tests. I always love to see the documentation continue to improve to better serve the community! Coming in Django 5.1, there will be a new template tag {% query_string %} that allows changing a django.http.QueryDict instance for … -
Weeknotes (2023 week 44)
Weeknotes (2023 week 44)Unmaintained but maintained packages There’s a discussion going on in the django-mptt issue tracker about the maintenance state of django-mptt. I have marked the project as unmaintained in March 2021 and haven’t regretted this decision at all. I haven’t had to fix inconsistencies in the tree structure once since switching to django-tree-queries. And if that wasn’t enough, I get little but only warm and thankful feedback for the latter, so that’s extra nice. Despite marking django-mptt as unmaintained I seem to be doing a little bit of maintenance still. I’m still using it in old paid projects and so the things I do to make the package work for me is paid work. I’m not personally invested in the package anymore, so I’m able to tell people that there are absolutely no guarantees about the maintenance, and that feels good. Read the Docs I do understand why the .readthedocs.yaml file is now necessary. I wish that I wouldn’t have to do all the busywork of adding one to projects. I have just resubscribed to the Read the Docs Gold Membership which probably has expired at some point in the past. Read the Docs is excellent and everybody … -
Introducing djarter – An opinionated Django starter project
I have spent six years resisting the urge to make a starter template because (a) it locks you in to a particular development style, and (b) it prevents the repetition that promotes learning. But in the spirit of deploying high quality work, this repo contains a few best practices and useful tools for Django projects. These features would take a while to get set up from scratch, and might not be worth it for every project. But cloning this starter template can save you roughly a full day of work if you're planning to extend the built-in user authentication. Most importantly, though, no Bootstrap styling was used in the making of this template. Check out djarter on GitHub. -
Idempotent Jobs - Building SaaS with Python and Django #174
In this episode, we cleaned up the email sending job. I had to make some changes based on some discoveries that I made while researching how to track responses and associate the journal entries back to the user. While doing this clean up, we added a new Prompt model to make the email sending job idempotent for each day. -
Guide to setting up GeoDjango on Mac M1
There are a lot of guides on setting up GeoDjango and PostGIS. But most of them are outdated and doesn't work on Mac M1. In this article, let us look at how to set up GeoDjango on Mac M1/M2. Ensure you have already installed Postgres on your Mac. Install GeoDjango The default GDAL version available on brew fails to install on Mac M1. $ brew install gdal ==> cmake --build build Last 15 lines from /Users/chillaranand/Library/Logs/Homebrew/gdal/02.cmake: [javac] Compiling 82 source files to /tmp/gdal-20231029-31808-1wl9085/gdal-3.7.2/build/swig/java/build/classes [javac] warning: [options] bootstrap class path not set in conjunction with -source 7 [javac] error: Source option 7 is no longer supported. Use 8 or later. [javac] error: Target option 7 is no longer supported. Use 8 or later. BUILD FAILED /tmp/gdal-20231029-31808-1wl9085/gdal-3.7.2/swig/java/build.xml:25: Compile failed; see the compiler error output for details. Total time: 0 seconds gmake[2]: *** [swig/java/CMakeFiles/java_binding.dir/build.make:108: swig/java/gdal.jar] Error 1 gmake[2]: Leaving directory '/private/tmp/gdal-20231029-31808-1wl9085/gdal-3.7.2/build' gmake[1]: *** [CMakeFiles/Makefile2:9108: swig/java/CMakeFiles/java_binding.dir/all] Error 2 gmake[1]: Leaving directory '/private/tmp/gdal-20231029-31808-1wl9085/gdal-3.7.2/build' gmake: *** [Makefile:139: all] Error 2 We can use conda to install gdal. Create a new environment and install gdal in it. $ conda create -n geodjango python=3.9 $ conda install -c conda-forge gdal $ pip install django $ pip install psycopg2-binary …