Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Django Alphabet Filter Released with International Character Support
My previous post about the alphabet filter explained the first take at creating the alphabet filter. There were several issues, especially with international character sets, so we have revised the code to fix the issues and made it installable via PyPI. The Default Alphabet The default alphabet is the list of characters displayed in the admin even if there is no data for that character. As there is data, the letters of the alphabet are enabled. Any characters not in the default alphabet, but that exist in the data, are added dynamically. There is no easy way to determine what the default alphabet should be based on the language or locale. We hit several barriers while automating the default alphabet: The default character encoding (on a Mac and in English, at least) is ISO-8859-1, but Django tries to interpret it as UTF-8. The default character set includes too many characters. Some languages (I’m looking at you, Spanish) treat certain two-letter combinations as letters (e.g. ch and ll). Due to these issues, the default alphabet is now a setting named DEFAULT_ALPHABET . The default setting is the ASCII alphabet and digits. You can set the DEFAULT_ALPHABET to a string or list or tuple. If you only what the … -
Announcing djangoembed, rich media consuming and providing with Django
I'm pleased to announce the release of djangoembed, a django app for consuming and providing rich media. What is OEmbed? OEmbed is a format for allowing a rich representation of a url. If you've used Facebook you've probably seen this feature before -- linking a YouTube video will embed an actual video player in the news feed, automatically. The player is represented by some HTML, plus there may be additional metadata like the author, a link to their channel, the title of the video, or even a thumbnail. -
Integració del TVP CECA
Després de barallar-m'hi un bon grapat de dies he aconseguit integrar el TPV de CECA en una de les aplicacions que estic desenvolupant per APSL. Com en el cas de la integració amb el BBVA he de dir que la qualitat de la documentació és inversament proporcional al suport que tens dels tècnics, per a que quedi clar: la documentació és pèssima, plena de inconsistències i exemples que no funcionen. El suport dels tècnics de CECA molt bo. Poc temps per a contestat (llevat de si demanes en divendres, clar) i respostes clares i concises. Un deu! Amb la gent del BBVA el mateix, se coneix que els ha tocat bregar amb la documentació. No acab d'entendre què costa mantenir la documentació actualitzada. Si ja no es fa servir un programa per a generar la firma, llavors es refà la documentació i se'n lleva la referència. Si s'incorpora un tag obligatori nou que s'ha d'enviar, llavors s'actualitzen els exemples. Per si a algú més li serveix faig cinc cèntims del que m'he trobat i del que funciona a l'hora d'escriure aquest apunt. Generació de la firma La firma és diferent per l'enviament i per la resposta. En ambdós casos es … -
GvR on commit privileges
Guido van Rossum: Maybe we’ve been too careful with only giving commit privileges to to experienced and trusted new developers. I spoke to Ezio Melotti and from his experience with getting commit privileges, it seems to be a case of “the lion is much more afraid of you than you are afraid of the lion”. I.e. having got privileges he was very concerned about doing something wrong, worried about the complexity of SVN, and so on. -
Europython 2010 talk: Advanced Django ORM Techniques
Here are the slides from my talk at Europython 2010, Advanced Django ORM Techniques. Advanced Django ORM techniques The talk is mainly a summary of the query optimisation tricks I've previously talked about on this blog, although I did begin by explaining briefly how models, fields and relationships work behind the scenes - I'll write some of that up here at some point. I'll also be posting a longer review of Europython here, hopefully in the next few days. Update: here's the (unfortunately fairly poor-quality) video from the talk: -
Europython 2010 talk: Advanced Django ORM Techniques
Here are the slides from my talk at Europython 2010, Advanced Django ORM Techniques. Advanced Django ORM techniques The talk is mainly a summary of the query optimisation tricks I've previously talked about on this blog, although I did begin by explaining briefly how models, fields and relationships work behind the scenes - I'll write some of that up here at some point. I'll also be posting a longer review of Europython here, hopefully in the next few days. Update: here's the (unfortunately fairly poor-quality) video from the talk: -
Release: django-treebeard 1.61
django-treebeard 1.61 has been released (CHANGES). It’s in pypi so you can install it with pip or easy_install. You can get the code in the Mercurial repo. There is also a well maintained Git mirror. Please report bugs in the bug tracker. Share and enjoy. -
Django using Eclipse IDE and Pydev
I’ve been using Wingwares python IDE for Django development for almost 2 years. The Wingware IDE has been very good but I have had a few superficial annoyances with it so decided to look around and see what other IDE’s I could use. This led me to Eclipse. The first time I had a look [...] -
AlertGrid - instant notification in Python/Django
AlertGrid is an interesting online instant notifications service (written in Python/Django) that helps reacting on the custom events (server down, script error, machine stopped) by sending SMS/phone/email notification. -
twod.wsgi 1.0 is out! (Enhanced WSGI support for Django applications)
I'm very pleased to announce that twod.wsgi 1.0 has been released, after several months of production use and preview releases! No bug has been found in the release candidate and therefore the final release has the same code as the candidate one.twod.wsgi allows Django developers to take advantage of the wealth of existing WSGI software, as the other popular Python frameworks do. It won’t break you existing Django applications because it’s 100% compatible with Django and you can start using the functionality offered by this library progressively.Get it while it's hot! -
Easier custom Model Manager Chaining
Easier custom Model Manager Chaining. A neat solution to the problem of wanting to write a custom QuerySet method (.published() for example) which is also available on that model’s objects manager, without having to write much boilerplate. -
Django 1.2 Tutorials: Django by Example
A few Django 1.2 tutorials by andreai.avk covering topics like Django admin customization, comment notification and moderation, thumbnail creation, searching and filtering, and automated testing. Current demos include a To-Do App, a Simple Blog, a Photo Organizing and Sharing App and a Simple Forum. -
What to do when PyPI goes down
Lately PyPI, the Python package index, has been having some availability issues. When PyPI goes down it really hurts Python developers: we can’t install new packages, bring up new development environments or virtualenvs, or deploy code with depedencies. Work is ongoing – see PEP 381 – to add much-needed resiliency to PyPI, and the fruits of these labors are starting to become available. In particular, a number of PyPI mirrors are now available: b. -
Setting up a template_postgis on Lucid
I wasn't able to find instructions in the Django docs for setting up a template_postgis database with postgis-1.5 and Postgres 8.4 on Ubuntu Lucid (10.04). Below is what worked for me. GeoDjango installed via Ubuntu 10.04 packages 1 2 3 4 5 6 7 8 9#!/usr/bin/env bash POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib createdb -E UTF8 template_postgis # Create the template spatial database. createlang -d template_postgis plpgsql # Adding PLPGSQL language support. psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql # Loading the PostGIS SQL routines psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" # Enabling users to alter spatial tables. psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;" GeoDjango built from source Use the above script, but change POSTGRIS_SQL_PATH to: POSTGIS_SQL_PATH=`pg_config --sharedir`/contrib/postgis-1.5 Make sure to run sudo ldconfig after compiling everything, or else postgis won't be able to find geos. You'll see errors like this: psql:/usr/share/postgresql/8.4/contrib/postgis-1.5/postgis.sql:59: ERROR: could not load library "/usr/lib/postgresql/8.4/lib/postgis-1.5.so": libgeos_c.so.1: cannot open shared object file: No such file or directory -
Builtin template tags and filters in Django
A good feature of Django Framework is the template tags and template filters. But it sucks when you have to load the filters in each template like this: {% load mytemplatetags %} It was much better if you just use the filters, without the need to load it. The reason you have to load is to achieve [...] -
Documenting Django pluggable apps with Sphinx
I decided to document my Django projects with the same tool used by Django team: Sphinx. It is a very good documenting tool, and was used for many other projects, including the Python Project itself. But it has a simple problem with Django, that I found the solution rlazo’s blog. But it still has some problems, [...] -
Reffering to Django docs from your docs using Sphinx
Sphinx is a great documentation tool, and one of it’s built-in extensions is sphinx.ext.intersphinx. It simply takes your objects references for other projects and converts to links in the other project’s documentation. In sphinx-quickstart command, it asks if you want to add this extension. If so, It adds this code to your conf.py file: extensions = ['sphinx.ext.intersphinx'] intersphinx_mapping [...] -
Arquivos do Mini curso de Django disponibilizados
No dia 24 de abril de 2009, no SENAC em Natal/RN, ocorreu o FLISOL. Neste evento, eu ministrei um mini curso de django. Então estou disponibilizando tanto os arquivos_mini_curso desenvolvido durante o curso, como os slides. Mini curso introdutório ao DjangoView more presentations from vbmendes. -
Django Aggregation Released
The aggregation is already available in Django SVN version. Now, it’s possible to do things such count authors of all book entries, count comments os all post entries, sum values of all sales to a client and much more. Here is the official documentation of this feature: http://docs.djangoproject.com/en/dev/topics/db/aggregation/ -
Festival Latino-americano de Instalação de Software Livre
Venho através deste convidá-los ao FLISOL/RN 2009. O Festival Latino-americano de Instalação de Software Livre do RN irá acontecer no dia 25 de abril de 2009 no SENAC em Natal. No evento eu irei ministrar um mini-curso introdutório ao framework Django das 14:00 as 17:00 horas, cujo objetivo é formar pessoas com conhecimentos básicos acerca do [...] -
External apps i18n in Django
Django has the good feature of internationalization. It’s very simple to use that it generates the .po files automatically from your project. All you have to do is complete the .po file with the translated text. To create these files, all you have to do is create a folder in your project called locale and [...] -
Django ORM now supports fields references in filters
Today was added a new feature to django ORM. Now it supports references to fields in filters expressions. Just checkout the SVN version and enjoy it. Before this update, queryset could be filtered only by absolute values. queryset.filter(field='absolute value') Will generate somthing like this: SELECT * FROM table_name WHERE field = 'absolute value'; Now you can filter by another’s table [...] -
MEDIA_URL and context from processors available in HTTP 500 template
It’s easy to create a custom template for HTTP 500 errors. All you have to do is create a file named 500.html in any of the application’s TEMPLATE_DIRS. But in almost all cases you want to use media in this page. It’s good to have an error page with the same look and feel of [...] -
get_first_object_or_none shortcut for Django
I will talk about a shortcut I developed for the Django framework and always use in my apps. This code is aimed in making a quik shortcut to obtain the first object of a queryset if it exists or None otherwise. It’s very useful when you want to display the last news in the first page [...] -
Marcus: двуязычный блог
Ещё в январе я тихо заменил здесь WordPress на самописный блог. Публично это отразилось разве что в двух твитах, и никакого поста я про это не написал. Отчасти из-за лени, отчасти от того, что всё там было довольно банально. Один из плюсов собственного блогософта в том, что к нему можно прикручивать новые фичи именно в таком виде, в котором хочется. И после реализации в блоге двуязычности, я посчитал, что стоит сделать небольшой технический обзор. Сразу скажу, что я не планировал блог, как коробочное приложение. И хотя написан он в автономном стиле, он, всё же, достаточно своеобразен и вряд ли подойдёт по фичам большинству блогеров. Код Код можно смотреть в бранче на Launchpad'е. Его получилось немного -- около 860 строк, и он, как по мне, хорошо читается. Интересно, что примерно 250 строк из всех ушло как раз на двуязычность. Впрочем, строчек непосредственно в коде блога получилось так немного, потому что много чего вынесено в библиотеки: pingdjack используется для рассылки и приёма pingback'ов scipio с его антиспам-конвейером заведует авторизацией по OpenID в комментариях subhub реализует персональный PSHB-хаб, благодаря чему посты мгновенно появляются в яндексовом Поиске по блогам и, следовательно, Подписках -- новом воплощении старой Я.Ленты. Фичи Ничего экстраординарного блог собой не представляет. …