Dec. 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 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. An URL-y warning Suppose you’re writing a blog in Django, and you get to the point where you’re setting up the URLs for the entries. Django has two ways to write … Read full entry
Read MoreDec. 16, 2023 » james.walters.click » [Archived Version]
On the heels of DjangoCon (sorry, a restrospective is overdue for that one, it's coming, I promise), I went and signed up for another conference—PyOhio! I decided to throw my hat in the ring with a talk on web scraping. It's a fun skill that I've put to use …
Read MoreDec. 15, 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 lurking problem Imagine you write a Python library named, say, foo. And you diligently set up the configuration to package it for distribution (which is not that hard; you can … Read full entry
Read MoreDec. 15, 2023 » Matthias Kestenholz: Posts about Django » [Archived Version]
Weeknotes (2023 week 50)django-imagefield The path building scheme used by django-imagefield has proven problematic: It’s too likely that processed images will have the same path. I have changed the strategy used for generating paths to use more data from the source; it’s now possible (and recommended!) to set IMAGEFIELD_BIN_DEPTH to a value greater than 1; 2 or 3 should be sufficient. The default value is 1 which corresponds to the old default so that the change won’t be back…
Read MoreDec. 15, 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. Functionally a database On top of the basic query syntax we’re all used to, SQL databases tend to have a large number of built-in functions — some of which are standardized, some … Read full entry
Read MoreDec. 14, 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 view to a database Most databases support creating and working with views, which, if you’ve never encountered them before, are like a virtual table — instead of being defined by … Read full entry
Read MoreDec. 13, 2023 » Matthias Kestenholz: Posts about Django » [Archived Version]
django-json-schema-editorI have extracted a JSON editing component based on @json-editor/json-editor from a client’s project and released it as open source. It isn’t the first JSON editing component by far but I like it a lot for the following reasons: It works really well. It supports editing arrays of objects using a tabular presentation. Tabular isn’t always better, but stacked definitely isn’t always better as well. The data structure is defined as JSON schema,the…
Read MoreDec. 13, 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. Inheritance and its discontents People can, and do, debate whether inheritance in object-oriented programming languages is a thing that ought to exist. There are even debates about what “inheritance” ought to mean … Read full entry
Read More