Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Stack Overflow a boon to stuck developers
Developing web applications is a little like learning how to ollie a skateboard. You try, and try, and try. Then you try again. And then something clicks. You land the trick. But you don't understand why. This has been my experience writing code. I know what I want to do, and through brute force I hammer away at a solution until something works. But why does it work? That's where Stack Overflow and it's wonderful community comes in. Let me be clear: I'm no computer scientist. I have a diverse background that includes public relations and journalism in addition to web development. But I know HTML, CSS and JavaScript very well. This trifecta led me into higher-level development languages like Python, and the wonderful framework Django a few years ago. Perhaps it's my tenacious journalist attitude that keeps my head beating against the wall in an attempt to solve problems. Whatever it is, I'm thankful there exists helpful communities on the web. Stack Overflow is a question and answer website where developers of any language can pose a mud-pit scenario from which they can't seem to escape. If the question is well-crafted, and tagged appropriately, answers glom like flies on … -
Retrocompatibilitat
Aquesta setmana m'he trobat en una situació on pots veure la diferència entre fer feina amb un llenguatges com Python i un bastiment com a Django, vers fer-ho amb altres tipus de bastiments (sí Rails, t'estic parlant a tu) amb distinta filosofia de feina i de com s'han de fer les actualitzacions. Rails i Django són cosins germans. Els dos van intententant agafar el millor que té l'altre. Permeten desenvolupar aplicacions web amb molta rapidesa i són molt divertits per fer-hi feina. La gran diferència és en la filosofia de feina: Django i Python tenen força cura en la compatibilitat cap enrera, en que a cada versió hi pugui haver canvis, però que siguin de tal manera que en la seva gran majoria les aplicacions segueixin funcionant amb modificacions mínimes. Rais i Ruby, per la seva banda tenen un historial de anar trencant amb tot el que hi ha a cada versío. El més important és la novetat, en la màgia del que es pot fer, en el factor sorpresa per tal de deixar la claca bocabadada. Però què passa quan el que tens són aplicacions que s'han de mantenir al llarg de molts anys? Com deia aquesta és una … -
On TRUCEConf
Yesterday brought news of TRUCEConf. It’s a terrible, dangerous and insulting idea. The organizers should reconsider, either canceling the event or changing its scope and mission radically. I have no doubts that the organizers have good intentions, but good intention don’t always yield positive results. As is, TRUCEConf’s very existence runs counter to the vision of equality in tech. Tone arguments and trivialization It’s hard to read the verbiage on TRUCEConf‘s home page as anything other than an extended tone argument. -
Sentry on Riak
Over the course of getsentry.com, one thing has become abundantly clear: you can never have too much disk space. In the 20 months it's been running, we've doubled our disk consumption six times. This may not sound like a big deal, but we've always tried to be tight on expenses, and it... -
Sentry on Riak
Over the course of getsentry.com, one thing has become abundantly clear: you can never have too much disk space. In 20 months it’s been running, we’ve doubled our disk consumption six times. This may not sound like a big deal, but we’ve always tried to be tight on expenses, and it … -
Sentry on Riak
Over the course of getsentry.com, one thing has become abundantly clear: you can never have too much disk space. In the 20 months it’s been running, we’ve doubled our disk consumption six times. This may not sound like a big deal, but we’ve always tried to be tight on expenses, and it gets even m... -
Release of Colibri 1.0-beta2
Time flies, and I haven’t made any release of Colibri for a long time, despite it being used in production and bug being fixed as they are found. So here it is. No shiny new feature there, it’s mostly about bug fixing, code cleaning and updating the code. More importantly: Colibri now requires Django 1.6, […] -
We Don't Know All The Things
Our guest this week is Laura Cassell, software engineer/instructor at Big Nerd Ranch and founder of Pyladies Atlanta! -
My First Django Sprint
This year I attended my first DjangoCon and, needless to say, it was pretty amazing. I also attended my first Django Sprint after DjangoCon was over. It was a fantastic opportunity to work alongside some of the members of the core team and to learn more about how decisions are ... -
Using strace to Debug Stuck Celery Tasks
Celery is a great tool for background task processing in Django. We use it in a lot of the custom web apps we build at Caktus, and it's quickly becoming the standard for all variety of task scheduling work loads, from simple to highly complex. Although rarely, sometimes a Celery worker may stop processing tasks and appear completely hung. In other words, issuing a restart command (through Supervisor) or kill (from the command line) doesn't immediately restart or shutdown the process. This can particularly be an issue in cases where you have a queue setup with only one worker (e.g., to avoid processing any of the tasks in this queue simultaneously), because then none of the new tasks in the queue will get processed. In these cases you may find yourself resorting to manually calling kill -9 <pid> on the process to get the queue started back up again. We recently ran into this issue at Caktus, and in our case the stuck worker process wasn't processing any new tasks and wasn't showing any CPU activity in top. That seemed a bit odd, so I thought I'd make an attempt to discover what that process was actually doing at the … -
Using strace to Debug Stuck Celery Tasks
Celery is a great tool for background task processing in Django. We use it in a lot of the custom web apps we build at Caktus, and it's quickly becoming the standard for all variety of task scheduling work loads, from simple to highly complex. -
Upload Files
Learn how to use Django to let your users upload files. This uses only what is built into Django to get you started.Watch Now... -
ShipIt Day 4: SaltStack, Front-end Exploration, and Django Core
Last week everyone at Caktus stepped away from client work for a day and a half to focus on learning and experimenting. This was our fourth ShipIt day at Caktus, our first being almost exactly a year ago. Each time we all learn a ton, not only by diving head first into something new, but also by hearing the experiences of everyone else on the team. -
ShipIt Day 4: SaltStack, Front-end Exploration, and Django Core
Last week everyone at Caktus stepped away from client work for a day and a half to focus on learning and experimenting. This was our fourth ShipIt day at Caktus, our first being almost exactly a year ago. Each time we all learn a ton, not only by diving head first into something new, but also by hearing the experiences of everyone else on the team. DevOps: Provisioning with SaltStack & LXC+Vagrant We have found SaltStack to be useful in provisioning servers. It is a Python based tool for spinning up and configuring servers with all of the services that are needed to run your web application. This work is a natural progression from the previous work that we have done at Caktus in deploying code in a consistent way to servers. SaltStack really shines with larger more complicated systems designed for high availability (HA) and scaling where each service runs on its own server. Salt will make sure that the setup is reproducible. This is often important while testing ideas for HA and scaling. The typical cycle looks like: Work on states in Salt Run Salt through Fabric building the whole system, locally through vagrant, on a cloud provider, … -
django-nomad-notifier
We have been busy lately working on some projects (still under development) that required a notification system for the different events triggered by the users activity. You know, the kind of notifications from your favorite social networks for things like "Congratulations ! You have unblocked a new bagde" or "User Slothie is now following you", usually received via email and also displayed on the site itself. For this we released, a few weeks ago, a new Django app called django-nomad-notifier: https://github.com/Nomadblue/django-nomad-notifier Do not expect a typical "batteries included" project, in fact it is really the opposite. But we are trying here to provide a nice documentation (the "usage" section) to guide any user to make good use of the idea behind this: http://django-nomad-notifier.readthedocs.org/en/latest/ As usual, comments, pull requests, forks, etc, are welcome! -
Death Defying Lifelines
Our guest this week is Clinton Blackburn, photographer, aerial silks person, and software engineer for Kyruus in Cambridge, Mass. -
Django Extensions notnull_differ
Django Extensions SQLDiff command is looking for somebody with MySQL skills to help out. In the GIT version of Django-Extensions we improved support for detecting NOT NULL changes in database. However this is currently only implemented for SQLite and PostgreSQL. We would like for the MySQL support to not lag behind the other backends. So are you using MySQL and have 30 mins to an hour to spare ? Then consider helping out and add notnull_differ support for MySQL to SQLDiff :) Link to get started: https://github.com/django-extensions/django-extensions/blob/master/django_extensions/management/commands/sqldiff.py#L506 -
Our Python 3 migration status
IP Street’s application runs on Python 2.7. Earlier this week, I evaluated all our Python packages for Python 3 support, as the first step in deciding when to migrate our codebase. Although this was the time I’ve checked our packages for Python 3 support, I expected Django to be the only one that didn’t officially support it. (Production support is slated for version 1.6, which is now in release-candidate.) But Django is the only project whose development roadmap I closely follow! D’oh! Talk about a blind spot!! This is why it’s good to sit down and formally check each package. Make a list of every package and check each one… Of the 29 packages we use, 20 (69%) support Python 3 and nine (31%) do not. I was really surprised by two of the non-Python 3 packages. The nine packages are: django. Python 3 support was “experimental” in version 1.5, and is production-quality in version 1.6, which is imminent. django-guardian. The documentation doesn’t explicitly say “supported in Python 3.” OTOH, it has closed Python 3 tickets, is under active development, and Django 1.6 is just over the horizon. I’m guessing/hoping this supports Python 3 shortly after Django 1.6 releases. django-mobile. … -
Django's dictsort template tag
dictsort [1] Takes a list of dictionaries and returns that list sorted by the key given in the argument. Eg: {{ value|dictsort:"name" }} The documentation would let you to believe you can only sort dicts with it. What to do if you have a list of strings ? After a bit of fumbling around it turns out that dictsort doesn't do a mere __getitem__ on each object but instead will take each object as a template context and evaluate the key as a variable, like {{ name }} would. What does this mean ? It means you can sort a list of strings by using the least changing method as the sort attribute. Remember that django automatically calls any functions in templates. Example: >>> from django.template import Template, Context >>> print Template("""{% for i in items|dictsort:"lstrip" %} ... {{ i }} ... {% endfor %}""").render(Context({ ... 'items': ["x", "a", "c", "b"] ... })) a b c x Ofcourse, this won't work very well if your strings start with spaces. What else can you do? You can get in depth: >>> print Template("""{% for i in items|dictsort:"a.b.c.d" %} ... {{ i|safe }} ... {% endfor %}""").render(Context({ ... 'items': [ ... {'a': … -
Django's dictsort template tag
dictsort [1] Takes a list of dictionaries and returns that list sorted by the key given in the argument. Eg: {{ value|dictsort:"name" }} The documentation would let you to believe you can only sort dicts with it. What to do if you have a list of strings ? After a bit of fumbling around it turns out that dictsort doesn't do a mere __getitem__ on each object but instead will take each object as a template context and evaluate the key as a variable, like {{ name }} would. What does this mean ? It means you can sort a list of strings by using the least changing method as the sort attribute. Remember that Django automatically calls any functions in templates. Example: >>> from django.template import Template, Context >>> print Template("""{% for i in items|dictsort:"lstrip" %} ... {{ i }} ... {% endfor %}""").render(Context({ ... 'items': ["x", "a", "c", "b"] ... })) a b c x Of-course, this won't work very well if your strings start with spaces. What else can you do? You can get in depth: >>> print Template("""{% for i in items|dictsort:"a.b.c.d" %} ... {{ i|safe }} ... {% endfor %}""").render(Context({ ... 'items': [ ... {'a': … -
Flat as a Pancake
A week on a remote island leads to a lot of squashed things. I'm not entirely sure if they're related. After a wonderful relaxing week at /dev/fort on the Isle of Eigg - somewhere I can heartily recommend if you're after amazing landscapes in remote places - work continues on migrations, in amongst the preparations for my move to the US. The last two weeks has been entirely focused on migration squashing - the ability to take an existing set of migrations, replace them with just one migration, and then have all new installations use that one migration instead of taking minutes running all the small migrations you committed that evening when you just felt like adding some random new columns. But how? The way this is done is reasonably simple - we simply take the existing migrations, extract all of their operations, and concatenate them into one big list. This is, clearly, going to do the same thing as all the smaller migrations, and it's quite nice not having a hundred names flying past you when you first run migrate. It's still almost as slow, though; behind the scenes you're still issuing loads of ALTER TABLE commands on brand-new … -
Releasing BoutiqueHotel.me
Last week, me and Ted Valentin released our new website, BoutiqueHotel.me. Boutique hotels are, for those who don't know, (usually quite small) hotels with thought-through concepts and unique attributes. You can for example check out boutique hotels in Stockholm or gothenburg boutique hotels. The site's tech stack is Python + Django & Celery, PostgreSQL with PostGIS as database, memcached for caching and Redis as Celery's backend/broker. All maps on the website are powered by wonderful Leaflet. Hopefully, I will be be open sourcing some of the website's code through some JS/Python libs. For example our image viewer which calculates how to distribute the images to create a perfectly balanced photo album. I've realised that there are a lot of really nice hotels, and my current favorite is probably Treehotel in Harads quite far up north in Sweden. Our aim with this site is to have the largest collection of the world's boutique hotels, and to give a far better experience when searching for boutique hotels than any other site out there. For this reason, we've started with just releasing the site for Sweden, and Swedish boutique hotels, but in the upcoming weeks we will roll out more countries. -
Django Extensions 1.2.5
Django-Extensions version 1.2.5 is as a bug fix release for 1.2.4. Fixes two bugs in admin extensions: Fix autocomplete image pixel Fix ForeignKeySearchInput Javascript -
A list of Evennia topics
Some Evennia updates. Development Lots of work has been happening in the dev-clone of Evennia over the last few months.As alluded to in the last blog, the main work has been to move Evennia's webserver component into the Server-half of Evennia for various reasons, the most obvious one to make sure that all database writes happen in the same process, avoiding race conditions. But this move lead to a rework of the cache system, which in turn lead to me having to finalize the plans for how Out-of-Band protocols should be implemented server-side. And once that was finalized, OOB was pretty much implemented anyway. As part of making sure OOB trackers were updated correctly at all times meant reworking some of the ways data is stored ... So one thing led to another making this a bigger update than originally planned.I plan to make a more detailed post to the mailing list soon with more technical details of the (relatively minor) API changes existing users should expect. The merging of the clone into the main repo is still a little way off, but adventurous users have already started testing things.Google CodeI like Google Code. It's easy to manage and maintain, … -
Minify Django
Minify Django