web | https://www.b-list.org/ |
---|---|
Author | James Bennett |
Nov. 4, 2024 » James Bennett » [Archived Version]
’Tis the season when people are posting their “Django wishlists”, for specific technical or organizational or community initiatives they’d like to see undertaken. Here are a few examples from around the Django community: Sarah Boyce Tim Schilling Andy Miller Emma Delescolle So, in the spirit of the season, here is my own list, which I’ve narrowed down to three wishes (in the tradition of many stories about wishes), consisting of one organizational item and two technic…
Read MoreAug. 27, 2024 » James Bennett » [Archived Version]
There’s a concept that I’ve heard called by a lot of different names, but my favorite name for it is “the Highlander problem”, which refers to the catchphrase of the campy-yet-still-quite-fun Highlander movie/TV franchise. In Highlander, immortal beings secretly live amongst us and sword-fight each other in hopes of being the last one standing, who will then get to rule the world forever. And when one of them is about to eliminate another, … Read full entry
Read MoreDec. 25, 2023 » James Bennett » [Archived Version]
This is the last of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction. Python contains multitudes There are a lot of container types available in the Python standard library, and it can be confusing sometimes to keep track of them all. So since it’s … Read full entry
Read MoreDec. 24, 2023 » James Bennett » [Archived Version]
This is part of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction. Unicode’s unique complexity It is the year 2023 — almost 2024! — and hopefully you’re using a programming language that is fully Unicode-aware. Python is; its string type is a sequence of … Read full entry
Read MoreDec. 22, 2023 » James Bennett » [Archived Version]
This is part of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction. Cookies in the cookie jar Django’s request and response objects, and their attributes and methods, make dealing with cookies easy. You can read from the request.COOKIES dictionary to get a cookie, and … Read full entry
Read MoreDec. 22, 2023 » James Bennett » [Archived Version]
This is part of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction. Attributing the problem Suppose you’re writing Java and you write a class with an attribute : public class MyClass { public int value; } And then later on you realize that value … Read full entry
Read MoreDec. 21, 2023 » James Bennett » [Archived Version]
This is part of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction. Check it out While you can do very minimal Django setups, more typical use cases tend to involve a mix of applications — your own, some third-party, and some from django.contrib — … Read full entry
Read MoreDec. 19, 2023 » James Bennett » [Archived Version]
This is part of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction. Let this be a warning Python provides the ability to issue a warning as a step below raising an exception; warnings are issued by calling the warnings.warn() function, which at minimum … Read full entry
Read MoreDec. 19, 2023 » James Bennett » [Archived Version]
This is part of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction. A-sync-ing feeling Async Python can be useful in the right situation, but one of the tricky things about it is that it requires a bit more effort to run than normal synchronous … Read full entry
Read MoreDec. 17, 2023 » James Bennett » [Archived Version]
This is part of a series of posts I’m doing as a sort of Python/Django Advent calendar, offering a small tip or piece of information each day from the first Sunday of Advent through Christmas Eve. See the first post for an introduction. Being methodical about Python Python classes support three basic types of methods: Instance methods, which are what you get by default when writing a def statement inside a class body. These are … Read full entry
Read More