Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django News - Django 3.2.8 and Python 3.10.0 now available! - Oct 8th 2021
News Django bugfix release: 3.2.8 A new bugfix that fixes two issues from 3.2.7. As ever, the best security practice is to always be on the latest version of Django. Here's how to upgrade. djangoproject.com Python Insider: Python 3.10.0 is available Python 3.10.0 is the newest major release of the Python programming language, and it contains many new features and optimizations. blogspot.com 🎃 GitHub's guide to Hacktoberfest 2021 October is Hacktoberfest, and there are better-defined rules this year and plenty of Django and Python projects that are looking for contributions. github.blog Events PyCascades 2022 is back! The CFP (Call for Proposals) is open now and closes Sunday, October 24th. Speaker invitations will be sent out Monday, November 15th. pretalx.com DjangoCon US 2021 DjangoCon US 2021 will be online only on October 22-23. Make sure to grab a free ticket in advance. djangocon.us Sponsored Jobs 💼 Canopy is hiring software engineers! We are seeking experienced software engineers to join our talented engineering team. We provide social impact programs evaluation & technical tools to maximize success! canopyteam.org Articles Django Fellow Reports Carlton Gibson, one of two Django Fellows, has moved his Fellow Reports to his website. These are excellent ways to catch … -
Bulk Delete Form - Building SaaS with Python and Django #117
In this episode, I worked on the bulk delete form that I need so that my customers can delete many tasks in the system at once. -
Bulk Delete Form - Building SaaS #117
In this episode, I worked on the bulk delete form that I need so that my customers can delete many tasks in the system at once. -
How to Delegate Meeting Attendance
Wrapping up my series on delegation with an example: how to delegate meeting attendance. -
Dutch python meeting: behaviour driven development - Jan-Hein Bührman
(One of my summaries of a talk at a Dutch python meeting, this one in october 2021 at the Amersfoort zoo) Behaviour driven development (BDD) is something that gets mentioned at python meetups and conferences from time to time. See this example from 2019. What is behaviour driven development? The core point is that you specify feature behaviour. Concrete, realistic examples to create a shared understanding of how the system should behave. It is defined as a scenario: Input Actions Outcomes What is commonly used is the "Gherkin" language: "given .... when .... then ....". In Java, "cucumber" is a well-known library for BDD. In python you have behave. BDD has a big benefit: you have concrete examples in an unambiguous specification. And it is in a language that can be understood by everyone from customer to programmer. An example: Scenario: simple google search Given: the google homepage is displayed When: the user enters "panda" in the search bar Then: links related to "panda" are shown on the results page. "Given" describes the initial stable state. "When" describes the action that's relevant for the scenario. "Then" describes the outcome of the action. You can add "and" statements to expand on … -
Dutch python meeting: structural pattern matching - Sebastiaan Zeeff
(One of my summaries of a talk at a Dutch python meeting, this one organised by Ordina in october 2021 at the Amersfoort zoo) Link to his slides Structural pattern matching (PEP (python enhancement proposal) 634) is the main new feature of the new python 3.10. Not everyone was happy with structural pattern matching. One of the comments: I see the match statement as a domain specific language that looks like python, but that does something surprisingly differently. Yes it is a special mini-language. A bit like regular expressions, which is also a special mini-language within python. What is structural pattern matching? It is not a simple C++ "switch" statement. One of the differences is that python's "match" statement only matches one of the patterns: with C++, you'd have to add "break" statements otherwise you can have multiple matches. It is not just matching string literals. Structural pattern matching tries to match objects by their shape. So: the value and/or the type. For sequences: how many elements? Dicts: which keys? What kind of values? Which attributes does an object have? This is how it looks: match <target>: case <pattern> [if <guard>]: <block of code> case <pattern> [if <guard>]: <block of … -
Django REST Framework Views - ViewSets
This article takes a deep dive into Django REST Framework's most powerful view, ViewSets. -
Django News - Python 3.10 and PostgreSQL 14 Release - Oct 1st 2021
News PostgreSQL 14 Released! The PostgreSQL Global Development Group announced the release of PostgreSQL 14, the latest version of the open-source database. postgresql.org What’s New In Python 3.10 New syntax features, additions to the standard library, typing features, and a few deprecations. python.org Python 3.10 Release Stream Python 3.10 is set to be released on 4 October 2021. Join us live in our Python 3.10 Release Stream with Pablo Galindo, CPython Core Developer and Python 3.10 Release Manager, and Leon Sandøy. youtube.com Events Django Girls Mentors needed for DjangoCon US DjangoCon US is partnering with Django Girls and we're looking for mentors. Please visit our signup form. We are looking for 15 engineers to help with one of the most rewarding aspects of Open Source Software: bringing new people into the community! We look forward to seeing you there! djangogirls.org Sponsored Jobs 💼 Canopy is hiring software engineers! We are seeking experienced software engineers to join our talented engineering team. We provide social impact programs evaluation & technical tools to maximize success! canopyteam.org Articles New Testing Features in Django 4.0 Django 4.0 had its first alpha release last week and the final release should be out in December. It contains … -
High Performance Django Is Free Online
In 2014 Yann Malet and I (with the help of the rest of the team here) wrote a book about building and scaling Django websites. It was the culmination of things we'd learned from, at the time, close to a decade of experience building, deploying, and supporting Django sites. It's been seven years since its release and it's fair to say that the book has run its course. While I didn't feel good about continuing to sell the book given its age, I also believe it still contains a lot of valuable information. As you'd expect, after seven years, many of the technical examples are outdated. The book, however, is largely conceptual. Code snippets are rarely the "secret sauce" when scaling a site. Topics such as caching and reducing/optimizing database queries aren't usually coding challenges. In fact, thanks to the stability of Django, much of that code is still the same today. So instead of relegating the book to the dustbin, we're releasing it for free online. It's something we've wanted to do for a long time and I'm excited to finally get the book in more people's hands. You can find it on this site at https://lincolnloop.com/high-performance-django/. -
High Performance Django Is Free Online
In 2014 Yann Malet and I (with the help of the rest of the team here) wrote a book about building and scaling Django websites. It was the culmination of things we'd learned from, at the time, close to a decade of experience building, deploying, and supporting Django sites. It's been seven years since its release and it's fair to say that the book has run its course. While I didn't feel good about continuing to sell the book given its age, I also believe it still contains a lot of valuable information. As you'd expect, after seven years, many of the technical examples are outdated. The book, however, is largely conceptual. Code snippets are rarely the "secret sauce" when scaling a site. Topics such as caching and reducing/optimizing database queries aren't usually coding challenges. In fact, thanks to the stability of Django, much of that code is still the same today. So instead of relegating the book to the dustbin, we're releasing it for free online. It's something we've wanted to do for a long time and I'm excited to finally get the book in more people's hands. You can find it on this site at https://lincolnloop.com/high-performance-django/. Photo by … -
Bulk Delete View - Building SaaS with Python and Django #116
In this episode, I started a bulk delete view to make it possible for customers to delete many course tasks at once. -
Bulk Delete View - Building SaaS #116
In this episode, I started a bulk delete view to make it possible for customers to delete many course tasks at once. -
Django REST Framework Views - Generic Views
This article looks at how to use Django REST Framework's Generic Views to prevent repeating certain patterns over and over again. -
Django 4.0
Django 4.0 alpha 1 released Django 4.0 release notes - UNDER DEVELOPMENT DjangoCon US 2021It’s About Time: DjangoCon US 2018 talk by Russell Keith-Mageeawesome-django repo Support the ShowThis podcast does not have any ads or sponsors. To support the show, please consider visiting LearnDjango.com or Button. -
New Testing Features in Django 4.0
Django 4.0 had its first alpha release last week and the final release should be out in December. It contains an abundance of new features, which you can check out in the release notes. In this post we’ll look at the changes to testing in a bit more depth. 1. Random test order with --shuffle¶ The release note for this reads: Django test runner now supports a --shuffle option to execute tests in a random order. I’m delighted that Django now has this option. It gives us strong protection against non-isolated tests. When tests are not isolated, one test depends on the side effect from another. For example, take this test case: from django.test import SimpleTestCase from example.core.models import Book class BookTests(SimpleTestCase): def test_short_title(self): Book.SHORT_TITLE_LIMIT = 10 book = Book(title="A Christmas Carol") self.assertEqual(book.short_title, "A Chris...") def test_to_api_data(self): book = Book(title="A Song of Ice and Fire") self.assertEqual( book.to_api_data(), {"title": "A Song of Ice and Fire", "short_title": "A Song ..."}, ) The tests pass when run forwards (test_short_title first), but fail in reverse. This is because test_short_title monkeypatches Book.SHORT_TITLE_LIMIT to a new value, and test_to_api_data’s expected data depends on this change. Non isolated tests can arise all too easily in an evolving … -
Django REST Framework Views - APIViews
This article takes a deep dive into how Django REST Framework's views work and its most basic view, APIView. -
Creating dynamic RSS feed with parameters
<![CDATA[ Creating dynamic RSS feed with parameters Setting up basic RSS feed with Django is pretty quick process thanks to Syndication framework included in Django. And it turns out setting up RSS feed that takes a parameter is not significantly more involved. For my IndieAppsCatalog I wanted to generate separate RSS feeds for all categories, so people could follow just "Productivity" category, for example. Let's see how this is done, with emphasis on what is different from setting up basic RSS. Setting up the feed You need a way to identify the "base object" the RSS feeds uses. For that we can use get_object method: class NewlyAddedAppsByCategory(Feed): author_name = "Indie Apps Catalog" def get_object(self, request, category_id, **kwargs): return AppCategory.objects.get(appstore_id=category_id) This is the key difference from basic RSS feeds which don't make use of the get_object method. Next you can change properties of the feed like title, link or description to be methods which allows you to customize them based on the category. For example: def title(self, obj): return "IndieAppsCatalog: Newly added apps to '{0}'".format(obj.display_name) def link(self, obj): return obj.get_absolute_url() The obj is AppCategory instance so we can use its display_name property to customize title for this RSS feed. Customizing what … -
Briefing a Delegate
Some managers think delegation is easy: you just ask someone on your team to go do a thing, then kick back with your feet on the desk until it’s done. Not true: delegating that way is a recipe for failure. To delegate effectively, you need to set up your delegate for success. This means explaining the work and desired outcomes, providing context, and teaching your delegate any skills they’ll need to be successful. -
How to load a Service Worker in Django
A service worker, part of the family of web workers, is, to put it shortly, a particular type of JavaScript code which can run off the main thread of execution. This has a number of benefits. In particular, service workers make possible to augment web applications with offline capabilities, and fine-grained cache management. In this brief post we see how to load a service worker in Django. The shortest introduction ever to service workers To put it simply, a service worker is like a proxy sitting in between the network and the web application. How to use a service worker? In its simplest form, we can load a service worker from any web page of the application, as in the following example: // Place this preferably in your app entry point: if ("serviceWorker" in navigator) { window.addEventListener("load", () => { navigator.serviceWorker .register("/service-worker.js") .then(registration => console.log("Service worker registered", registration) ) .catch(err => console.log(err)); }); } Here we check that the browser supports service workers, and we wait for the load DOM event before triggering the service worker registration: // navigator.serviceWorker .register("/service-worker.js") // This snippet is really important, and we can notice that we load our service worker from the root of … -
Django News - Django 4.0 alpha 1 released - Sep 24th 2021
News Django 4.0 alpha 1 released Django 4.0 alpha 1 is now available. It represents the first stage in the 4.0 release cycle and is an opportunity for you to try out the changes coming in Django 4.0. djangoproject.com Zappa is now deprecated Zappa was a serverless Python project that attracted wide attention. Unfortunately, the maintainers do not have the time to keep it alive. Feel free to fork and have a go at it if you have the time and inclination. github.com awesome-django now has discussions! The awesome-django repo repo now has 4.4k stars and is managed by Jeff Triplett and William Vincent. github.com Katia Lira Awarded the PSF Community Service Award for Q2 2020 Katia Lira, Software Engineer from Mexico city, has been awarded the Python Software Foundation 2020 Q2 Community Service Award. Katia is the President of DEFNA and a DjangoCon US organizer. blogspot.com Sponsored Jobs 💼 Canopy is hiring software engineers! We are seeking experienced software engineers to join our talented engineering team. We provide social impact programs evaluation & technical tools to maximize success! canopyteam.org Articles How to Decouple Your App From its Operating System with Docker See how we upgraded the version of Python … -
Finish School Break Filtering - Building SaaS with Python and Django #115
In this episode, we finished the UI work and wrote the final tests needed to complete the school break filtering by student feature. -
Finish School Break Filtering - Building SaaS #115
In this episode, we finished the UI work and wrote the final tests needed to complete the school break filtering by student feature. -
Cloning a Single Production Database Table from Heroku to Local Database with PostgreSQL in Docker Compose
I have a few Django apps in a Django project. I used factory_boy to mock a bunch of the data, but I have a few hundred rows of… -
Cloning a Single Production Database Table from Heroku to Local Database with PostgreSQL in Docker Compose
I have a few Django apps in a Django project. I used factory_boy to mock a bunch of the data, but I have a few hundred rows of accurate data in my production database. It made sense to work on a copy of that data as it contains no sensitive user information. My project is hosted on Heroku with one of their free tier PostgreSQL databases. My local environment is a Docker Compose stack with images for Python, PostgreSQL, and Redis. The trickiest part here, in my opinion, is finding out just how to get the backup to the PostgreSQL docker container. Table of Contents Table of Contents Backup the Production Database Clone to Local Database Conclusion Backup the Production Database There are two easy ways to do this on Heroku Use the Heroku CLI Use the Heroku web interface The Heroku docs detail how to make a backup. Use the Heroku CLI to Backup Database So first, if you aren’t already using it, you’ll need to install the Heroku CLI and run heroku login. Next, you’ll need to know your app’s name in Heroku. Mine is mastering-fitness, but you can get a list of all your Heroku apps right … -
People- vs Results-Oriented Management: Both Work!
Broadly speaking, there are two management styles: people-oriented and results-oriented management. Taken to extremes both styles have failure modes, but seeking “balance” isn’t the answer. Both modes can be successful! Embrace the style that comes easiest to you, while learning enough about the other mode to avoid pitfalls.