Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
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. -
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 … -
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. 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, … -
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. -
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, … -
Skinny Django
Skinny Django -
Minify Django
Minify Django -
Quick and handy wheel package format for Python applications
Python packaging needs some help. A solution to at least some problems may be wheel - a new format for fast and efficient software installation and distribution. It's described in few PEPs and now it's starting to take shape. It was showcased recently on PyCon PL 2013. There is nearly no wheels on pypi but we can use them locally to make local installations faster (handy for continuous integration systems and alike that build a project from scratch often). -
IP Street is looking to hire a Senior Developer! (Seattle)
If you know someone who fits the bill, send them this post! ———————————— Title: Senior Developer Reports to: VP Engineering About IP Street Founded in 2009, IP Street develops and markets software to help corporations, law firms, and financial analysts better analyze patent-related information. We make IP data easy to get, use, and understand! Summary We’re a start-up that’s developed a new way to visualize and data-mine intellectual property. We’re small and scrappy, have an innovative engineering team, and have built the business on awesome products that companies buy! Our technology stack is almost all open-source, with some nifty esoteric search technologies. Most of your work will be in Python and Django, in a Mac-based development environment, deploying to Linux. Other technologies include Celery, Postgres, Redis, and Solr. Our client-side code relies on Highcharts and Backbone, and supports desktop and mobile users. This is “small b” big data, with lots of interesting challenges! Responsibilities Collaborate with others in product direction, priorities, and features Design, implement, and test new product (primarily but not exclusively server-side) features Some front-end coding and debugging, as needed Make the user experience as powerful, simple, and manifest as possible Be positive, flexible, and do what’s needed … -
Flamewars as a Service
Our guest this week isBuddy Lindsey, host ofGoDjangovideos, works atConsumerAffairs.com.00:00:00.000 Intro00:05:45.000 Kiwi PyCon Videos00:07:00.000 Hardware is Hot00:12:43.000 Humans vs. Zombies00:15:15.000 django-easy-timezones00:20:00.000 Deploy Django00:24:46.000 pyenv00:29:30.000 Heroku Websockets00:33:56.000 Your own mini-Heroku00:37:40.000 Github tmux status00:40:18.000 Most Liked and Disliked Programming Languages -
Django Extensions 1.2.4
Django-Extensions version 1.2.4 got released as a bug fix release for 1.2.3. Turns out I made a small packaging mistake and the new templates for graph_models where not included in the release. -
Build a scalable feed using Stream-Framework and Django
It’s been a year since the original version of this blogpost was written and it’s time for an update. The Stream-Framework is currently the largest open source solution for building newsfeed. This post will point you in the right direction if you want to build a newsfeed using Stream-Framework and Django. We’ll be building an example app like this Pinterest style demo. Besides the open source Stream Framework we also offer a hosted solution for building newsfeed applications at getstream.io. The example application code for the hosted version can be found on Github. For the open source framework the example app code can be found here. Share and Enjoy: -
Django Extensions 1.2.3
Django-Extensions version 1.2.3 is out :) Bringing the usual bug fixes, improvements, etc. Special this time is that a bunch of extensions that had not seen changes in a long time got some new love. A special thanks for the contributions to SQLDiff and graph_models this time around. A new version of SYNC_MEDIA_S3 was also merged, now simply called sync_s3. The old version sync_media_s3 still exists but will be deleted around march 2014. Please give the new version a try if your using this ! :) ChangeLog: sqldiff support for doing diffs involving many-to-many relations sqldiff support finding missing foreignkey relations sqldiff now supports Table Inheritance graph_models now supports both pygraphviz and pydot graph_models refactored use of django templates so it's easier to change and extend graph_models sort items and make sure primary_key and foreignkeys are always on top graph_models (hopefully) make database relations (primary key and foreignkey) more clear graph_models do not hide foreign keys from attribute list (added option for if you want to hide this) graph_models allow to specify default values in settings file for graph_models command graph_models show inheritance arrows per default shell_plus Added SHELL_PLUS_PRE_IMPORTS and SHELL_PLUS_POST_IMPORTS which allow for including additional import directives before the … -
Django – Muito além do básico
Estou na Latinoware e acabei de apresentar uma parte da palestra “Django – Muito além do básico”. Sala lotada, público interessado, mas infelizmente houve um incidente nos encaminhamentos finais da palestra: acabou a luz! Sim, estou dentro da usina de Itaipu e o bloco em que estávamos ficou todo no escuro! Vou tentar ver com a organização se consigo um repeteco dessa palestra. Mas deixo aqui os slides que foram apresentados e fico à disposição para tirar qualquer dúvida. Obrigado a todos os participantes! Django – Muito além do básico from Christiano Anderson O post Django – Muito além do básico apareceu primeiro em Christiano Anderson. -
django-nbskel
Well it was time already to give some more code into the public domain and the community, so I decided to release my personal way of starting new django projects. I call it django-nbskel ("nb" for nomadblue and "skel" for skeleton). Development code can be found, along with my other apps, in Bitbucket: http://bitbucket.org/nabucosound/django-nbskel/ The project page is here. The purpose if this application is to contain a basic django project and help you out configure it to speed up the process of starting up a new development, be it a quick hack or a long project. I often need to produce new django projects and I don't enjoy doing repetitive things. They start basically with the same structure so with this app I can wrap all the first steps into a couple of actions. It also makes me feel secure because I always tend to forget to initialize settings, include files, import modules, and so on, so with django-nbskel I am sure I am beginning to develop upon a tested and stable code. Please be warned this is code that automates stuff for me, so you will be probably modifying it to fit your django configuration, tools, and deployment …