| web | http://simonwillison.net/ |
|---|---|
| Author |
Sept. 24, 2024 » Simon Willison's Weblog: django » [Archived Version]
nanodjango Richard Terry demonstrated this in a lightning talk at DjangoCon US today. It's the latest in a long line of attempts to get Django to work with a single file (I had a go at this problem 15 years ago with djng) but this one is really compelling. I tried nanodjango out just now and it works exactly as advertised. First install it like this: pip install nanodjango Create a counter.py file: from django.db import models from nanodjango import Django app = Django() @app.admin # Registe…
Read MoreSept. 15, 2024 » Simon Willison's Weblog: django » [Archived Version]
UV — I am (somewhat) sold Oliver Andrich's detailed notes on adopting uv. Oliver has some pretty specific requirements: I need to have various Python versions installed locally to test my work and my personal projects. Ranging from Python 3.8 to 3.13. [...] I also require decent dependency management in my projects that goes beyond manually editing a pyproject.toml file. Likewise, I am way too accustomed to poetry add .... And I run a number of Python-based tools --- djhtml, poetry, ipython, l…
Read MoreAug. 13, 2024 » Simon Willison's Weblog: django » [Archived Version]
New Django {% querystring %} template tag Django 5.1 came out last week and includes a neat new template tag which solves a problem I've faced a bunch of times in the past. {% querystring color="red" size="S" %} Adds ?color=red&size=S to the current URL - keeping any other existing parameters and replacing the current value for color or size if it's already set. {% querystring color=None %} Removes the ?color= parameter if it is currently set. If the value passed is a list it will append ?col…
Read MoreAug. 8, 2024 » Simon Willison's Weblog: django » [Archived Version]
Yesterday I finally developed something I’ve been casually thinking about building for a long time: django-http-debug. It’s a reusable Django app - something you can pip install into any Django project - which provides tools for quickly setting up a URL that returns a canned HTTP response and logs the full details of any incoming request to a database table. This is ideal for any time you want to start developing against some external API that sends traffic to your own site - a webhooks provide…
Read MoreJuly 17, 2024 » Simon Willison's Weblog: django » [Archived Version]
Announcing our DjangoCon US 2024 Talks! I'm speaking at DjangoCon in Durham, NC in September. My accepted talk title was How to design and implement extensible software with plugins. Here's my abstract: Plugins offer a powerful way to extend software packages. Tools that support a plugin architecture include WordPress, Jupyter, VS Code and pytest - each of which benefits from an enormous array of plugins adding all kinds of new features and expanded capabilities. Adding plugin support to an op…
Read More