Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
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 -
Skinny Django
Skinny 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 … -
Django translations for lazy programmers
I came to a dirty but practical solution for one minor project I had to develop for a client who wanted a website with i18n capabilities and also needed to have the different translations for each candidate values each in a different field, in the same model. That is, one field for each language. Here in this post I explain how to achieve it. Let's say we have some models with some fields we want to be duplicated, one for each language. In this example, we will store english (en), spanish (es) and french (fr): class MyObject(models.Model): name = models.CharField(max_length=50) title_en = models.CharField(max_length=50) title_es = models.CharField(max_length=100) title_fr = models.CharField(max_length=100) description_en = models.CharField(max_length=100) description_es = models.CharField(max_length=100) description_fr = models.CharField(max_length=100) class MyOtherObject(models.Model): name = models.CharField(max_length=50) content_en = models.CharField(max_length=200) content_es = models.CharField(max_length=200) content_fr = models.CharField(max_length=200) Notice we append a suffix to each field consisting of an underscore plus the language code. It is important to set the field names this way, as we are going to use a template tag that uses this suffix to find the proper translated field. Next thing to do is add a new TRANSLATION_FIELDS setting that will contain all the field names for ALL your model fields that … -
My thoughts on DjangoCon Berlin 2010
During this past week I attended DjangoCon, which took place in Berlin thanks to the German Django Association, a non-profit organization founded by german djangonauts. Interesting talks about Django, WSGI, NoSQL, testing, CouchDB, MongoDB, South or front-end design, to name a few. And in the evening or night, geeks gathered in Berlin pubs for beers and fun. I found a relief in meeting so many other people using Django, we djangonauts are a sort of lonely rangers here in Spain. The community is expanding, at the same pace that Django project is growing. In fact, it has already become a grown up in the open source ecosystem, and I think this fact is one of the main reasons that brought Jacob Kaplan-Moss give the first talk in the opening day about how we, Django users/developers/commiters, have to behave with the project itself and to the eyes of the others. The pony, a silly mascot that can be embarrassing to somebody (picture a girl asking her parents to buy her a pony, or a gay decorating his bedroom with stuffed animals, and you won't find the scene much related to guys with beards, pirates, ninjas or geeks hacking python) is precisely … -
New release of django-nomadblog
My Django blogging app, django-nomadblog, is sporting a new look after I added many features I needed for some of my present and future project developments. Mainly, I wanted to turn this app into a multiple blogging system, which means I am able to create and manage multiple blogs from the same installation, via admin interface. The implementation of this followed some improvements in the code and the modularity of the app itself. To upgrade this django blog to the new version of django-nomadblog, I should have created a migration using South, for example. But considering the small size of the database and the project inn general, I went the lazy way and created a fixture from the old database, edited by hand to meet the new models and relationships, and imported it to a fresh database. My punishment for being lazy was missing to update django.contrib.sites to replace the default example.com with nomadblue.com, and to include the data related to the projects site section in the fixture. I'll never learn. -
Using disqus comments and django-localeurl
Lately I have added comments to my company blog. We have it localized, so things turned out to be not so straight forward as one can think. django-localeurl This neat piece of code allows us to localize our URLs. You can find it in its bitbucket repository. So, in my blog I have four languages (english, catalan, spanish and french), each one with a different prefixed URL: http://example.com/blog/post_slug/ http://example.com/ca/blog/post_slug/ http://example.com/es/blog/post_slug/ http://example.com/fr/blog/post_slug/ Note that the english version doesn't have any prefix actually; this is a default from django-localeurl but you can change it if you want. disqus url So we want to include, of course, comments to our blog, and we are going to use disqus, a well-known service that makes our life more enjoyable without having to carry the burden of spam comments, implementing all the ubiquitous facebook, twitter, and many more logging services, to name a few. When using the universal JavaScript embed code, by default this script uses window.location to send the URL of the current page. As long as we are using localized URLs, if we don't modify this behavior then each localized URL would have its own comments. Hopefully, we can specify our URL with the …