Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django News - DSF Weekly Office Hours - Oct 18th 2024
News ➡️ Expression of interest: Django 6.x Steering Council elections The DSF is seeking candidates for the upcoming Django Steering Council 6.x elections—interested individuals can fill out this form to express interest or get feedback on their eligibility. google.com Why Django supports the Open Source Pledge Sentry is one of several partners who have launched the Open Source Pledge, a commitment for member companies to pay OSS maintainers meaningfully for their work. djangoproject.com Python Insider: Python 3.14.0 alpha 1 is now available It's now time for a new alpha of a new version of Python. blogspot.com Django Software Foundation Announcing weekly DSF office hours The Django Software Foundation is opening up weekly office hours, Wednesdays at 6PM UTC, to work on and discuss various DSF initiatives. djangoproject.com 2025 DSF Board Nominations Nominations for the Django Software Foundation are OPEN until October 25th. There have been a host of articles about what the next Board might accomplish to help progress Django. Consider applying! djangoproject.com DSF initiatives I'd like to see Former Django Fellow Carlton Gibson weighs in with his top three initiatives the new Django Software Foundation Board could work on. noumenal.es Updates to Django Today 'Updates to Django' is presented … -
Why you should run for the DSF Board, and my goals for the DSF in 2025
Applications are open for the 2025 Django Software Foundation Board of Directors – you can apply until October 25th. So, in this post I’ll do two things: try to convince you to run for the board, and document my goals and priorities for 2025. -
Epic Debugging, Hilarious Outcome - Building SaaS #205
In this episode, I dug into an issue with sign up. What I thought was going to be a minor issue to fix turned into a massively intense debugging session. We ended up going very deep with the django-allauth package to understand what was going on. -
Epic Debugging, Hilarious Outcome - Building SaaS #205
In this episode, I dug into an issue with sign up. What I thought was going to be a minor issue to fix turned into a massively intense debugging session. We ended up going very deep with the django-allauth package to understand what was going on. -
Managing Django Projects on Your Server with Style
This article is outdated, you’ll find an updated article here. A friend is in the process of setting up a new slice at everbody’s favorite VPS provider Slicehost and asked for some advice. I use MySQL, Nginx & Apache/mod_wsgi on Ubuntu to serve Django. I think Slicehost’s Articles are awesome and a great place to get help you get everything installed and running, so for this article, I’ll focus on some personal preferences regarding directory structure and repo management. One of the biggest difficulties I’ve had to tackle lately is the rapid progress of Django. I have a number of client sites hosted on my slice and have had to freeze them at certain times when backwards incompatible changes come along. My original approach made this really messy, because I only accounted for having one copy of any given third party repo, symlinked from /usr/local/src to my Python site-packages directory. My new approach takes advantage of being able to set your PYTHONPATH at runtime. My directory structure looks like this: |-django |--projects |---domain1.com |---domain2.com |---domain3.com Each site has the following structure: |-domain1.com |--apache |---django.wsgi |--django |--domain1_project |---__init__.py |---app1 |---app2 |---manage.py |---settings.py |---static |---templates |---urls.py |--third_party_repo1 |--third_party_repo2 Just drop domain1.com in … -
Building a Community Site with Django in 40 Hours or Less
All the recent hub bub about 1 week and 1 day application development, motivated me to see how quickly I could launch a website for myself. I, like many developers, struggle with building and releasing personal sites. Ask a web developer and they’re likely to tell you about a couple of sites they started and never finished. Time is always an issue, but the bigger problems are striving for perfection prior to launch and always holding out for that one “killer” feature. As time goes on, interest in the project wanes until it finally gets shelved. The Plan Prior to development, I set a few goals for myself: Launching quickly was priority number one. I set a goal of 3 days. Use as much existing code as possible. Even if it wasn’t a perfect fit, if it was functional, use it. Optimize later. Stop scope/feature creep at all costs. Stay focused. I’m easily sidetracked when working on personal projects. Notice “building a killer website” was not one of the goals. This project was strictly a speed challenge a’la Django Dash. The Idea I wanted to build a site cataloging mountain bike trails complete with full GPS data. I decided not … -
Django Newforms Admin Merged to Trunk
This was a huge feat. Congrats guys! 1.0 here we come. -
Django for Hire
Lincoln Loop has been in “head down” mode for the last couple months. In addition to being knee deep in client projects, we have grown from a one-man development studio to a full-fledged Django development shop/consultancy. We are proud to announce that Lincoln Loop is the first (that we know of) company focusing solely on Django application development. Our development team is currently five strong and oozing with talent. Each member contributes to the community in blog posts or open source add-ons; a few of us have contributed code to Django itself. More on our dev team in the near future. We went through the typical growing pains during the transition, but the kinks are worked out and we can officially say that we are open for business. Django projects big and small, send them our way. Our devs can handle nearly anything. New Django projects based on your specs Existing projects when your developer doesn’t have the time, doesn’t have the expertise or just skipped out on you Scaling up your existing development team for large feature pushes Ellington customization You name it, if it is Django related, we can probably help. Don’t be shy, drop us a line. -
Getting RequestContext in Your Templates
Lately, we’ve been taking over projects from people who began building their first site in Django, but either got in over their head or just found they didn’t have the time to continue. As I review the existing code, the first issue I typically see is using the render_to_response shortcut without including the RequestContext, preventing context processors from being used in the templates. The standard symptom is when people can’t access MEDIA_URL in their templates. Here are a few ways to add RequestContext to your templates. Option #1: Adding RequestContext to render_to_response The Django documentation recommends passing RequestContext as an argument to render_to_response like this: from django.shortcuts import render_to_responsefrom django.template import RequestContextdef my_view(request): # View code here... return render_to_response('my_template.html', my_data_dictionary, context_instance=RequestContext(request)) This works, but as you can see, it adds a fair amount of repetitive code to your views. Option #2: Wrapper for render_to_response Don’t repeat yourself. Create a wrapper like this, courtesy of Django Snippet #3 from django.shortcuts import render_to_responsefrom django.template import RequestContextdef render_response(req, *args, **kwargs): kwargs['context_instance'] = RequestContext(req) return render_to_response(*args, **kwargs) Option #3: Use Generic Views Django’s generic views include RequestContext by default. Although the docs show them being used in urls.py, you can just as easily use … -
On Static Media and Django
We all know not to serve static media (images, CSS, Javascript, etc.) in production directly from Django. Thankfully, Django gives us some nice settings like MEDIA_URL and MEDIA_ROOT to make serving them a lot less painless. Lately, however, I’ve come to realize that these settings shouldn’t really apply to all static media. Not All Static Media Is Created Equal Static media really comes in two flavors. Media that is part of your site like your stylesheets and user generated media or files that are uploaded to the site once it is live. We don’t want to serve all this media from the same place for a couple of reasons: Our source checkouts shouldn’t be crufted up by stuff our users are uploading User generated content and source code should live in two different places on the filesystem We could fix the first problem with some .gitignore, but that doesn’t solve the filesystem issue. Solution: Segregate Your Static Files The answer is to segregate your static files. Django already does this with ADMIN_MEDIA_PREFIX. We use two additional settings in our Django projects, STATIC_URL and STATIC_ROOT. This lets us put user generated content in MEDIA_ROOT outside our project while still serving STATIC_ROOT … -
Serving Django Projects (Revisited)
After reading the comments on my last post on the subject, I realized there was definitely some room for improvement in my strategy. This is take two of the original post. Problems My original strategy had a couple of downfalls: Poisoning the Python Path I was adding directories to the Python Path that weren’t Python. This raised the chance of namespace collision and just wasn’t a very clean way to do things. No project source repository I was still storing all my source files in one big folder. Tracking which project is using what was more difficult than it needed to be. Solutions The first step to recovery was forgetting about sharing libraries between projects altogether. In theory it sounds great, in practice it was cumbersome to manage. My directory structure now looks like this: |-domain1.com |--apache |---django.wsgi |--src |---domain1_project_src |---third_party_repo1 |---third_party_repo2 This is much cleaner and allows for simple control over the versioning on third party repositories. For source with stable <span class="caps">API</span>s, like Django 1.0, I still place it in <tt>/usr/local/src</tt>, allowing me to update all sites using the library in one go without worrying about breakage. Virtualenv is Your New Best Friend As recommended in the comments … -
Introduction to Gondola
Gondola is our content management system built on top of Django. I briefly showed it off during my DjangoCon Lightning Talk, but have been wanting to give it a proper screencast for a while. Here’s an introduction: A few common questions I don’t tackle in the screencast: Is this an open source project? As of right now, no. I do plan on spinning off a few bits as open source over time. In fact, the WYSIWYG editor is already on Google Code as django-admin-uploads. Unfortunately it hasn’t been synced up with our in-house code in a while and isn’t working on 1.0. We’ll get that updated at some point in the near future. How much will it cost? I haven’t settled on a pricing structure yet, but I want it to be affordable for small businesses. What version of Django are you running? 1.0 How’d you add all that stuff to the Django admin interface? It is really quite easy by just overriding a few of the default templates. I hope to write a blog post soon with more details. When can I get my hands on it? Soon. If you have a site you’re interested in putting on it … -
My Lightning Talk from DjangoCon 2008
DjangoCon was an amazing conference all around. I met some great people and learned a lot. I also had the opportunity to get up on stage and present some of the things I’ve been working on here. I was really nervous and after seeing how well prepared the presenters before me were, I had doubts about my plan to go on stage and wing it. I spoke about Trailmapping and Gondola the CMS I’ve been working on. Afterwards, I was blown away by the number of compliments I received. A few people told me they thought my talk was the best of the bunch which was really encouraging. To everyone that reached out, all I can say is thanks; it meant a lot. I’m inspired to carve out some more time to blog about the things I’m working on, specifically Django admin customization and jQuery. Well, it is now on YouTube for all to see. Skip forward to 18:50 if you just want to catch my talk and as I mention in the video, drop me a line or comment here if you’re interested in any of this stuff. Also, Trailmapping got a quick mention (32:22) during James Tauber’s Pinax … -
Simple & Easy Deployment with Fabric and Virtualenv
In the process of prepping Gondola CMS for public consumption, we’ve grown from having a developer (me), to having a development team. One pain point that quickly arose was the amount of time it took for new developers to setup a local development environment. In addition to our source code, the project depends on nearly a dozen other Django apps and Python packages. Initially, we simply tracked the requirements in a text file, but it required a lot of manual work to get them downloaded and installed. Necessity is the Mother of Invention Of course, this problem has been tackled many, many times before1. As I looked into what was out there, my first thought was that most of the existing options were far too complex for our needs. If I didn’t grok a system after clicking around the docs for 10 minutes or so, I moved on. The tool I eventually decided on was Fabric. I was attracted to Fabric, primarily because I found it simple and easy to understand. Unfortunately, I didn’t find a lot of information on using it for local buildouts, so I forged ahead building my own. fab bootstrap Our needs were simple. I wanted … -
Thibaud Colas - 2025 DSF Board Nominations
Thibaud on LinkedIn, on Mastodon Django on Mastodon, on LinkedIn2025 DSF Board NominationsDjango Forum Discussion of 2025 DSF Board ElectionsDSF Individual Members and Steering Council MembersTorchbox CTO and senior dev job offersWagtail high-profile users, newsletter, roadmapSponsorDjango Chat Podcast Sponsorship Information -
My Django wishlist explained
Recently Andy Miller - AKA nanorepublica posted in various media about missing Django batteries, including but not limited to this forum thread and articles series. He's not the only one, I have seen similar posts from several other people in my circles. Here I'll try to explaining my take on the original forum question -
Django News - Python 3.13 and Django 5.1.2 bugfix released - Oct 11th 2024
News Django bugfix release issued: 5.1.2 Three new bugfixes in the latest release. As always, the best security policy is being on the latest version of Django. djangoproject.com Python 3.13.0 released The official release for Python 3.13 and a listing of new and deprecated features. What's New in Python 3.13 is a detailed look at all the new features. python.org Python Insider: Python 3.12.7 released The seventh maintenance release of Python 3.12 is now available. blogspot.com Join the Python Developers Survey 2024 The annual Python Developers Survey is now live. This is your chance to weigh in on the current state of the language and the ecosystem around it. blogspot.com Django Software Foundation 2025 DSF Board Nominations Another reminder that nominations are open for the Django Software Foundation Board. Of our 7 directors, there are 4 positions currently open, with each position serving for two years. djangoproject.com If we had $1,000,000… Jacob Kaplan-Moss expanding on his DjangoCon US talk on what the DSF might do with more money. jacobian.org DSF initiatives I'd like to see An article-length gist from Django Fellow Sarah Boyce on what the DSF Board (and new members!) might accomplish. github.com Thoughts on the Treasurer Role at … -
Pycon NL: Localization and translation of programming languages - Felienne Hermans
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Localisation and translation of programming language: how to make programming languages more inclusive and why that matters. Felienne is professor at the vrije universiteit in Amsterdam. She also works at a school teaching 12 year olds. Those 12 year olds wanted to learn programming and she agreed to teach it. When she herself learned programming, it was in the 1980's without any adults in her environment to teach her. So she typed over some Basic code from a book and learned herself. That's how she learned programming. The compiler was the teacher and she learned to read error messages. But current 12 year olds don't learn that way: > print("Hello world") # <= Note the extra space in front of print ^^^ IndentationError "Teacher, what is an indentationerror?". Or rather in Dutch "juf, wat betekent een indentation error". So she tried to write a much simpler language to teach the kids. Simple code. "Lark" translates it to proper syntax. This is then converted to an "AST", abstract syntax tree. Which is then converted to python. See https://www.hedycode.com/ A request that came up quickly was if the keywords … -
Pycon NL: How bazel streamlines python development - Alexey Preobrazhenskiy
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Full title: how bazel streamlines python development: stories from the Uber monorepo. Monorepo: a single repository that contains multiple distinct projects, with well-defined relationships. There are advantages to monorepo's like developer productivity: code sharing, component reuse, reducing duplication. Atomic commits across components: you fix everything everywhere in one commit. And you have consistency and a common way of working. Bazel: https://bazel.build/ . A build system that allows you to define tools and tasks by writing code. With an ever-growing build-in set of rules to support popular langauges and packages. Bazel's language is called starlark, which is inspired by python. Some semantics differ, but the behaviour is mostly the same. Do you even need a build tool for python? Well, perhaps you have compiled cython modules. Or a javascript frontend. Code generation? In any case you probably need to generate deployable artifacts like wheels or debian packages. They wrote git-filter-repo to help you merge an existing repo into a monorepo, preserving the history. There is support for running tests. And optionally caching test results to prevent re-running unneeded tests (important in a huge code base). Caching is hard, … -
Pycon NL: Efficient python project setup with cookiecutter - Merel Theisen
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Full title: efficient python project setup: showing cookiecutter's potential within Kedro. Kedro: https://kedro.org/, "a toolbox for production-ready data science". Open source, python. It helps you apply regular software engineering principles to data science code, making it easier to go from prototype to production. Things like Jupyter notebooks are great for experimenting, but not nice when you throw it over the wall to some programmer to clean it up and convert it to "real" code. Kedro consists of: Project template. This is done with cookiecutter. Data catalog. Core declarative IO abstraction layer. Nodes + pipelines. Experiment tracking. Extensibility. Cookiecutter: https://cookiecutter.readthedocs.io/ . You use cookiecutter (the program) to create projects from "cookiecutter templates". Such a template gives you a repository structure out of the box, filled in with some parameters that you provide like the name of the project. Cookiecutter reads a settings file and prompts you interactively with some variables it wants you to provide. It then reads a directory structure and generates an output directory based on it. Really handy, as you normally get a README, some pyproject.toml or so, a proper directory structure, perhaps a sample … -
Pycon NL: Past, present and future of python parallelism - Pavel Filonov
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). In his job, he's waiting a lot. Waiting for his machine learning stuff to finish. Waiting for results to be calculated. In c++ you'd start enabling multiple processing to get your entire processor to work. How how about python? He showed a simple function to calculate prime numbers. A CPU bound problem. Everything he tests is run on an AWS t3.xlarge 4 CPU machine, The present Just simple single core. Pure non-parallel python. 1430 ms to calculate. You can use python extensions: you code it in c++ and use some library for splitting it up in multiple tasks. 25 ms, 60x faster. You can use python's own multithreading, using ThreadPoolExecutor. 1670 ms: wow, it is a little bit slower. Which is to be expected as the problem is CPU bound. Similar approach, with multiprocessing. ProcessPoolExecutor with three CPUs as worker. 777 ms, about twice as fast. Many python data processing libraries support multiprocessing. It is a good approach. The future You can look at multiple interpreters. PEP 734. And there's a PEP to have a GIL ("global interpreter lock") per interpreter. If you start up multiple interpreters, … -
Pycon NL: From state machines to event-sourced systems - Lukáš Ševčík
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Full title: Events in fintech: from state machines to event-sourced systems. He works at kiwi.com, a payment processor. They recently refactored their systems to be more event-based. Previously, they used state machines. A payment/customer/whatever can be in several well-defined states. Between states (but not necessarily between all states) there are transitions. Advantages of state machines: they're simple. Easy to understand. They're efficient. Easy to test: just states and transitions. Disadvantages: there's no inherent history. That's sometimes bad, as it is hard to answer "why is my payment in this state?!?" There's also lack of context. And changing a state machine can be hard. Some problems they encountered: race conditions. Two states are started for the same account. One gets a +15, the other a -20. As the states don't know about each other, the resulting account balance can be incorrect. Now on to events. Event sourcing / event driven architecture is what he called it. You start with a command "withdraw money, amount = 15". This gets placed in a queue and gets processed. The processing results in another event "15 has been removed" that gets send … -
Pycon NL: The zen of polymorphism - Brett Slatkin
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Brett is the writer of the effective python book. As an example, he picked a calculator that can add and multiply integers. The numbers, the operators: everything is an object in his example. You can do it with one big function, object oriented or with dynamic dispatch. One big function: just a big old recursive function with a lot of if/else. Just something to get started. Once you add more operators ("power of", "square root"), the if/else quickly gets out of hand and becomes much to long and unreadable. And lets say you don't only want to do the calculation, but you only want to have a nicely printed version of the calculation. Suddenly your only choice is to copy/paste the entire big function and change the calculation to print statements. And then you need to keep the two in sync... Second try: object oriented programming. Polymorphism. A generic Operator class with a calculate() method. Then subclasses called Add, Multiply, etc. Python does a magical thing: you can just call calculate() on whatever operator. Python handles part of the if/else for you. It calls the right calculate … -
Pycon NL: The zen of polymorphism - Brett Slatkin
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Brett is the writer of the effective python book. As an example, he picked a calculator that can add and multiply integers. The numbers, the operators: everything is an object in his example. You can do it with one big function, object oriented or with dynamic dispatch. One big function: just a big old recursive function with a lot of if/else. Just something to get started. Once you add more operators ("power of", "square root"), the if/else quickly gets out of hand and becomes much to long and unreadable. And lets say you don't only want to do the calculation, but you only want to have a nicely printed version of the calculation. Suddenly your only choice is to copy/paste the entire big function and change the calculation to print statements. And then you need to keep the two in sync... Second try: object oriented programming. Polymorphism. A generic Operator class with a calculate() method. Then subclasses called Add, Multiply, etc. Python does a magical thing: you can just call calculate() on whatever operator. Python handles part of the if/else for you. It calls the right calculate … -
Pycon NL: Using PyPI trusted publishing for ansible releases - Anwesha Das
(One of my summaries of the one-day Pycon NL conference in Utrecht, NL). Using software is easy, releasing software is harder. Originally trained as a laywer, she wondered why software had to be released so often. As a lawyer, she had to work with laws sometimes already written in 1860 :-) Nowadays she is the release manager of ansible. Ansible is ansible-core in combination with 95+ different python modules called collections. Originally, releasing to the python package index, pypi, wasn't really safe. Every person doing the release needed some __token__ in their ~/.pypirc. This can be compromised. And the token can be overscoped. And... can you be sure that every person doing the release is doing it in a safe way? That the person's laptop is secure enough? Pypi now allows you to use trusted publishing. OIDC, "openID connect", is used behind the scenes to connect pypi to github/gitlab/etc. It is a way to create short-lived tokens to upload to pypi from a github/gitlab job. A specific github repository and specific github action within that repository is set up as "trusted" by one of the maintainers of the project on pypi. The github action will, when uploading, use the OIDC …