Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
A fun little bug
About two months ago, I quietly wrote and released a little Django application which generates cross-domain policy files for Flash (if you’ve never encountered this aspect of Flash, here’s an introductory article on how it works). I’ve done a bit of hacking on it in my spare time, and I’m pretty happy with it as an example of a simple, tightly-focused application; sometime soon I hope to write a bit more about the development process ... Read full entry -
A fun little bug
About two months ago, I quietly wrote and released a little Django application which generates cross-domain policy files for Flash (if you’ve never encountered this aspect of Flash, here’s an introductory article on how it works). I’ve done a bit of hacking on it in my spare time, and I’m pretty happy with it as an example of a simple, tightly-focused application; sometime soon I hope to write a bit more ... Read full entry and comments -
Link Exchange For Tough Times
Advertising on Google is getting expensive, very expensive. This year advertising costs for Adwords rose between 40% and 60% for some advertisers. Companies like eBags.com and Babyage.com have seen the cost of advertising online soar to 45% of the cost of the product they are trying to sell. Margins are diminishing and [...] -
Practical Django Projects
June 2009 News Update: The second edition of this book has been released! The 2nd edition of Practical Django Projects has been released making this series of posts redundant! Notes and a practical companion I've been reading James Bennett's excellent Practical Django Projects (PDP), which uncritically I think is the best python based book I've read since I picked up Mark Lutz's Learning -
Psychic IRC Support In 10 Easy Steps
This list is somewhat specific to Django and #django channel on freenode.net. Psychic support is what people are looking for when they expect others to just know their development environment and their code. If one doesn’t supply enough information on the problem, no matter how good a hacker the person on the other end of [...] -
Second edition
So just after lunch today a box arrived, containing copies of the second edition of Practical Django Projects, which went through final editing about a month ago (Apress tends to be pretty quick at getting the book printed and shipping). Since I assume that means other people will be getting copies of the book soon, I’d like to cover a couple important bits of information. First of all, the second edition (as the cover proudly declares ... Read full entry -
Second edition
So just after lunch today a box arrived, containing copies of the second edition of Practical Django Projects, which went through final editing about a month ago (Apress tends to be pretty quick at getting the book printed and shipping). Since I assume that means other people will be getting copies of the book soon, I’d like to cover a couple important bits of information. First of all, the second edition (as the cover ... Read full entry and comments -
Untitled
hej -
Untitled
hej -
Что такое pip?
Pip это альтернатива easy_install, а как говорят сами разработчики - замена. Как известно easy_install только часть глыбы под названием setuptools. Много копий сломано по поводу нужно ли такие двухголовое чудовище, которое позволяет продвинутым образом собирать питонячьи пакеты и их устанавливать. Или достаточно стандартного distutils. Вот тут pip выступает как противоположность, говоря - я сборкой пакетов не занимаюсь, а только их ставлю. Pip может поставить любой пакет собранный при помощи distutils. Причем только source-пакет - никаких бинарных яиц ему и прочих setuptools'овых прибамбасов. Эта концептуальная простота во многом помогла pip постепенно выйти на уровень широко используемого инструмента в питон-сообществе. Благо и пользоваться им максимально просто: # pip install wna где wna - это некий пакет (для примера я возьму код своего блога). Так же преимуществом pip безусловно является более полезный вывод информации о процессе установки и репортинг ошибок во всяких непредвиденных ситуациях. Помимо уже собранных source-пакетов pip может брать исходники пакетов из систем контроля версий. Поддерживаются subversion, mercurial, git, bazaar. Делая checkout и устанавливая через python setup.py с ключом devel, дает возможность иметь в папке /src/packet_name/ исходный код и при необходимости редактировать его. # pip install -e hg+http://bitbucket.org/daevaorn/turbion/#egg=turbion Где egg=turbion говорит pip чтобы он сделал checkout в /src/turbion/. Очень полезная возможность, … -
sphinx autodoc and django app
Today I have been getting my foot wet with autodoc extension from sphinx. Here it is what the documentation of sphinx say about it :"""Sphinx is a tool that makes it easy to create intelligent and beautiful documentation, written by Georg Brandl and licensed under the BSD license."""I have to say that before today my experience with sphinx as been excellent. It is relatively straightforward to get started once you pass the first little annoyances that come with the fact that you are learning a new tool.The module I have been using to conduct this experiment is django-geotagging this reusable app enables you to geotag any object in the database. If you want to know more about this you can read the sphinx based documentation. This is the goal of the documentation, isn't it ? :-)If adding a manually written documentation is very easy and well documented. The modification required to move from a very primitive documentation written using some rst file to sphinx is shown here. Most of it is automatically generated by : sphinx-quickstart.Taking it a step further have been more difficult than anticipated and this for several reasons : lack of example, and a bugToday I wanted … -
How Great is Django's Documentation?
One aspect of Django that never ceases to amaze me, is how well it is documented. I believe this aspect of the Django project got many of us to use it, me included. While doing some boring graduate donkey work, Django’s name popped out, and not surprisingly, as one of the highly documented code bases out there (only projects focusing on documentation came close!). So lets me take this opportunity to thank all those who might be reading this, who had a hand in making Django what it is (Thank you!) The Lines of documentation to SLOC ratio is plotted against SLOC for 1st of Jan, 2009. Django has one of the highest ratios compared to other open source projects of similar size (See the top part of the Graph). Of course I could have plotted doc lines to SLOC, but then I have to show the deviation of Django from the regression line. This graph just makes it more obvious and is easier to plot: Click to enlarge, and don’t forget to zoom in. I also have a few questions should any Django contributors pass by. Any of you guys think that you might have over done it? Is it difficult to … -
ModelAdmin readonly fields
Finalizing my web application, there was a few outstanding patches left to do. One of this I always felt strange why it was left out in the open. Django's admin interface form by default allows you to edit the primary key of the model. I always felt strange why it allowed this as it led to unexpected behavior. My users would edit the primary key expecting the changes to be done on the record which of course did not happen as django created another new object with the new edited id. In solving this bug I was hoping that django's admin model allowed for something like 'readonly = ( 'id_field')' or something like to that respect. Just thinking out aloud but shouldn't this be automatically done for all primary key fields in models.py ? Shouldn't the primary key be made non editable by default unless explicitly stated in the definition? Even then should the primary key be allowed to be edited? If a user were to be allowed to edit the primary key, would it really be editing or 'cloning' a new object with similar data but differing ids? I haven't really done a thorough search yet but I think … -
Django-Loupe for Design Collaboration
I've been using Basecamp for years and have a love/hate relationship with it simply because it costs me money for clients that don't want to use it. However, I can't get rid of it because there are a few clients I have that need collaboration for designs. For coding projects I use various ticketing systems from Trac to Sifter and I won't get into that in this post. During a current project Trac is being used for the backend parts but it falls apart on design collaboration. After a few late nights I'm thrilled with the progress of Django-Loupe for design collab. -
Django - migracje z south
South jest jedną z najlepszych aplikacji do prostego tworzenia migracji struktur baz danych w Django. Używam south'a od wersji 0.3. I muszę powiedzieć że jest to naprawdę dobre narzędzie. Ułatwia prace przy tworzeniu i rozwijaniu aplikacji w Django. Normalnie gdy tworzymy aplikacje w Django i korzystamy z syncdb, gdy chcemy zmienić strukturę bazy danych to musimy albo usunąć całą bazę i ponownie wykonać syncdb lub pisać "ręcznie" SQL który zmieni tą strukturę. Dodatkowym problemem jest jeżeli chcemy później te same zmiany struktury bazy danych wykonać na środowisku produkcyjnym. Przy większych projektach jest bardzo uciążliwe i zajmuje bardzo dużo czasu. Chciałbym opisać tutaj swoje doświadczenia z south 0.5 i pokazać jego możliwości. Instalacja Jeżeli nie mamy jeszcze zainstalowanego south'a to instalujemy: easy_install south Zaczynamy: Tworzymy projekt który posiada dwie aplikacje books oraz authors. django-admin.py startproject southtest manage.py startapp books manage.py startapp authors Dopisujemy south oraz aplikacje books i authors do INSTALLED_APPS i robimy syncdb. South stworzy sobie tabele w której będzie trzymać historie migracji. Dopisujemy modele do aplikacji books i authors Modele z aplikacji authors: from django.db import models class Author(models.Model): name = models.CharField(max_length=30) Modele z aplikacji books: from django.db import models from southtest.authors.models import Author class Book(models.Model): name = models.CharField(max_length=30) … -
Djangodose Logo
I finally got some time to work on my backlog of logos this week and they are starting to hit the streets. So if you're waiting on me to finish the commissioned logos, they are coming quickly! Sorry for delays, it's been hell-busy here. First out the door is the new djangodose logo for they great guys of TWiD fame Eric Florenzano, Brian Rosner and Kevin Fricovsky. I believe they have announced they are recording this Sunday for those (including myself) who are anxious for the new show. I'm still working on the site design which will be finished just in time for the show release. -
Adaptador do Django para DB2 lançado!
Adaptador do Django para DB2 lançado! -
Adaptador do Django para DB2 lançado!
Adaptador do Django para DB2 lançado! -
EuroDjangoCon 2009
EuroDjangoCon 2009 is still going strong, but I wanted to share the materials from my talk as quickly as possible. My slides are on Slide Share:Forms, Getting Your Money's WorthView more presentations from kingkilr.And the first examples code follows:from django.forms.util import ErrorListfrom django.utils.datastructures import SortedDictdef multiple_form_factory(form_classes, form_order=None): if form_order: form_classes = SortedDict([(prefix, form_classes[prefix]) for prefix in form_order]) else: form_classes = SortedDict(form_classes) return type('MultipleForm', (MultipleFormBase,), {'form_classes': form_classes})class MultipleFormBase(object): def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=':', empty_permitted=False): if prefix is None: prefix = '' self.forms = [form_class(data, files, auto_id, prefix + form_prefix, initial[i], error_class, label_suffix, empty_permitted) for i, (form_prefix, form_class) in enumerate(self.form_classes.iteritems())] def __unicode__(self): return self.as_table() def __iter__(self): for form in self.forms: for field in form: yield field def is_valid(self): return all(form.is_valid() for form in self.forms) def as_table(self): return '\n'.join(form.as_table() for form in self.forms) def as_ul(self): return '\n'.join(form.as_ul() for form in self.forms) def as_p(self): return '\n'.join(form.as_p() for form in self.forms) def is_multipart(self): return any(form.is_multipart() for form in self.forms) def save(self, commit=True): return tuple(form.save(commit) for form in self.forms) save.alters_data = TrueEuroDjangoCon has been a blast thus far and after the conference I'll do a blogpost that does it justice. -
Google Appengine SDK 1.2.3
Google Appengine SDK 1.2.3 -
Read only fields in models
Supposing you have a field in your model and you don't want it to be changed, ever. -
stockphoto on bitbucket
So, development of stockphoto , my Django-based photo gallery application has been languishing for a long time. Like, three years ... -
stockphoto on bitbucket
So, development of stockphoto , my Django-based photo gallery application has been languishing for a long time. Like, three years ... -
Частные проблемы использования django-evolution
Сегодняшний день для меня ознаменовался эпичной битвой с django-evolution. С различными неудобствами этого приложения мы в разработке сначала Куда Все Идут, а потом Афиши сталкиваемся уже довольно давно. Сегодняшний же случай наконец заставил меня перебороть лень и изложить эти проблемы для публики. Должен, тем не менее, обязательно сказать, что не считаю django-evolution плохим средством, потому что знаю, что во многих сценариях использования он вполне справляется со своими обязанностями. Однако архитектурные особенности нашего проекта и наши рабочие привычки, видимо, совмещаются с ним плохо. Поэтому принимайте текст как есть, без далеко идущих выводов, просто к сведению. Очерёдность с syncdb Одно из выбранных решений django-evolution -- невмешательство в дела команды syncdb. То есть, django-evolution никогда не пытается выполнять SQL код для создания таблиц. Первое неудобство в этом для нас -- более сложный процесс составления миграционного SQL'а. Дело в том, что наши админы не шибко любят запускать изменения в базах всякими неконтролируемыми тулзами, а просят присылать им SQL-скрипты. Django-evolution умеет генерить SQL своих эволюций, а SQL для создания таблиц приходится вырезать руками из базы отдельно. Но гораздо хуже другое. Представьте, что в процессе миграции базы с достаточно старой версии есть и новые модели, и эволюции, применяемые к этим моделям. Поскольку создавать таблицы надо отдельной … -
Частные проблемы использования django-evolution
Сегодняшний день для меня ознаменовался эпичной битвой с django-evolution. С различными неудобствами этого приложения мы в разработке сначала Куда Все Идут, а потом Афиши сталкиваемся уже довольно давно. Сегодняшний же случай наконец заставил меня перебороть лень и изложить эти проблемы для публики. Должен, тем не менее, обязательно сказать, что не считаю django-evolution плохим средством, потому что знаю, что во многих сценариях использования он вполне справляется со своими обязанностями. Однако архитектурные особенности нашего проекта и наши рабочие привычки, видимо, совмещаются с ним плохо. Поэтому принимайте текст как есть, без далеко идущих выводов, просто к сведению. Очерёдность с syncdb Одно из выбранных решений django-evolution — невмешательство в дела команды syncdb. То есть, django-evolution никогда не пытается выполнять SQL код для создания таблиц. Первое неудобство в этом для нас — более сложный процесс составления миграционного SQL'а. Дело в том, что наши админы не шибко любят запускать изменения в базах всякими неконтролируемыми тулзами, а просят присылать им SQL-скрипты. Django-evolution умеет генерить SQL своих эволюций, а SQL для создания таблиц приходится вырезать руками из базы отдельно. Но гораздо хуже другое. Представьте, что в процессе миграции базы с достаточно старой версии есть и новые модели, и эволюции, применяемые к этим моделям. Поскольку создавать таблицы надо отдельной …