Community
This page, updated every hour, aggregates blog entries by people who are
writing about Django.
Posted on May 13, 2008 at 6:58 PM by Simon Willison
Django admin OmniGraffle stencil. Alex Lee put together a beautiful stencil for OmniGraffle containing all of the common UI elements seen in the Django admin interface, as a tool for wireframing.
Read this post in context »
Posted on May 13, 2008 at 9:07 AM by Simon Willison
django-db-log. Middleware that logs Django exceptions to the database, using a clever scheme based on an MD5 of the traceback text to group duplicate errors in to batches.
Read this post in context »
Posted on May 13, 2008 at 6:49 AM by Andrew Gleave
Just a quick note to say thanks to Brian Chow from Full Factor Technologies for becoming the first to sponsor Djangogigs.
Read this post in context »
Posted on May 13, 2008 at 2:00 AM by Alberto García Hierro
Latelly I've been hammered with a lot of spam in this blog, so I decided to implement something to prevent it. As I've previously mentioned, I don't like Akismet because it's too simple. It only tells you if they think the comment is spam, so the best you can do is skip writing comments to the database. It would be nice if it returned a probability, so you could act accordingly. For example, consider the following: If spam probability is 50% or below, accept the comment. If it's between 50% and 80%, present some validation method to the user. It could be a CAPTCHA or even something more simple like a message telling the user to resubmit the form before 30 seconds, since most of the spam bots wouldn't get that right. If it's more than 80%, discard the comment. But Akismet can't do that, so I will never use it. My initial idea was implementing my own spam detection system but, since developing ffloat.it keeps me busy enough, that's not something I can do for now. However, after reading the suggestion from Scott Lawton and reading the page he mentioned, I found I could write something to prevent most ...
Read this post in context »
Posted on May 12, 2008 at 5:39 PM by David Cramer
The question came up today, if there was a database logging solution available for Django. It turned out (to my knowledge) there wasn’t. So I quickly came up with django-db-log. It’s a simply middleware which will catch exceptions in Django, and log them to the database, allowing you to easily view them via the admin [...]
Read this post in context »
Posted on May 12, 2008 at 1:54 AM by Alex Koshelev
Давно уже сталкиваюсь с одним неудобством в повседневной работе с джангой. Например у нас есть моделька: class Entry( models.Model ): title = models.CharField( max_length = 150 ) type = <...> И каким полем выразить тип (да, знаю, что имя конфликтует со встроенным, но тут это не принципиально)? "Ха!" - скажут некоторые. Да просто взять IntegerField и сделать типы целыми числами от 0 до сколько надо. Легко! TYPES = ( ( 0, _( "inactive" ) ), ( 1, _( "active" ) ) ) class Entry( models.Model ): title = models.CharField( max_length = 150 ) type = models.PositiveIntegerField( choices = TYPES ) Казалось бы, проблема решена. И этим можно пользоваться. Но, тут сразу начинаются неудобства. Для того чтобы код не превращался в склад "магических чисел" надо добавить соответствующие константы, которые описывают эти два типа. INACTIVE = 0 ACTIVE = 1 # или даже INACTIVE, ACTIVE = range( 0, 2 ) потом можно пойти ещё дальше и выразить choices через них, чтобы было меньше дублирования TYPES = ( ( INACTIVE, _( "inactive" ) ), ( ACTIVE, _( "active" ) ) ) Теперь можно вполне себе удобно использовать это хозяйство. И выборки делать и прочие проверки с присваиваниями e = Entry.objects.get( name = "Спартак ...
Read this post in context »
Posted on May 11, 2008 at 8:41 PM by Simon Willison
Byteflow Blog Engine. This looks like the most full-featured of the Django blog engines by a pretty big margin, including OpenID client and server support. A product of the growing Russian Django community.
Read this post in context »
Posted on May 11, 2008 at 7:05 AM by Patrick Altman
So on one of our test servers I was doing some heavy performance testing when I noticed a strange OperationalError exception message in the Debug console for Django: I went digging around and sure enough I had all kinds of locks when I attempted: mysql> SHOW PROCESSLIST; So next I checked the status of the free space available [...]
Read this post in context »
Posted on May 10, 2008 at 11:37 PM by Marc Garcia
One of the key websites about Django is Django Snippets, by one of the key Django developers, James Bennett. I've followed many of the James work, and it's awesome; but I've a complaint on Django Snippets. It's the inefficient way to find anything there. The only ways that I've found is ...
Read this post in context »
Posted on May 10, 2008 at 11:08 PM by Marc Garcia
When working on multilanguage sites, a feature that many times I missed is a direct way to change the language when you're on the admin, With standard Django the only way that exists (as far as I know), is leaving the admin, going to the website, change the language there, and ...
Read this post in context »
Posted on May 10, 2008 at 2:45 PM by Peter Baumgartner
Lately, we’ve been taking over projects from people who began building their first site in Django, but either got in over their head or just found they didn’t have the…
Read this post in context »
Posted on May 10, 2008 at 1:39 AM by Marc Garcia
I know that it was just few days ago that I released another version of DSNP, but because of it, I got a lot of feedback on it, I worked hard, and finally DSNP is stable. For now, it'll be 0.9 because it works on Django newforms-admin branch, so 1.0 will ...
Read this post in context »
Posted on May 9, 2008 at 7:19 PM by PK Shiu
This is a common mistake. When defining a FileField or an ImageField, you need to specify where the files are stored. This is done by specifying a relative path in the upload_to argument. Django will then store your files in a subdirectory as named, under the MEDIA_ROOT directory. But, don’t put a leading ...
Read this post in context »
Posted on May 9, 2008 at 4:44 PM by Marc Garcia
I've been working with Django for a while, and it helped me to get all my web developments with nice urls. But I also wanted a nice url structure... What it is nice for me, opposite to Django default settings, is avoiding the media prefix on my media urls, so http://localhost/media/admin/css/login.css would ...
Read this post in context »
Posted on May 9, 2008 at 4:01 PM by Eric Moritz
I ran across Smisk two days ago and though. "Hmm, someone should write a wsgi adaptor for that". Maybe an hour after I had that thought, I started working on one. It was pretty easy. Smisk's classes seem to be inspired by WSGI, all the wsgi environment variables had a Smisk equivilent. So the adaptor was basically putting tab A in Slot B and Tab B is slot A, etc. If you noticed in my delicious feed. I bookmarked Smisk itself and three hours later, I bookmarked my launchpad branch of smisk-wsgi. Pretty cool. Fifteen hours later across the globe in Sweeden, Smisk's project owner Ramus Anderson, merged in my code in with some changes. So in a total of 3 hours, something went from concept to reality thanks to Python. I don't think quickness is a testimate to my mad hacking skills. It's really a testimate to Python's agility. So what is Smisk and why is it cool? Smisk is a low level web framework built in C but controled by Python. Basically it's a lightcgi interface to Python with some really well thought out classes bolted on. What does the wsgi adapter get you? It basically allows you ...
Read this post in context »