Via Simon Willison:
This is a really convenient way to add custom functions to model managers in Django. Way easier than defining custom managers each time you need extra functionality.
business development django funny future google howto linux politics programming python security tech web2.0 webdesign
@FilmnoirKate Out of Gas is a favorite of mine. Our Mrs Reynolds and Jaynestown are up there too.
Bookmarked via Diigo on Tuesday, July 20, 2010 @ 14:00 CDT by Daniel Andrlik
Via Simon Willison:
This is a really convenient way to add custom functions to model managers in Django. Way easier than defining custom managers each time you need extra functionality.
Bookmarked via Diigo on Thursday, May 20, 2010 @ 20:54 CDT by Daniel Andrlik
This is an older tutorial, but it works splendidly. I just used this approach with a Django 1.2 project I am working on to create a reCAPTCHA field for my custom forms. The automatic validation works like a charm.
Bookmarked via Diigo on Saturday, February 13, 2010 @ 15:43 CST by Daniel Andrlik
Django Debug Toolbar is an insanely useful Django app that you can drop into any Django project and get tons of useful information while developing and testing your work, all in a pretty sexy looking toolbar.
DjDT displays information such as:
There is a great video on the landing page that does an admirable job showing off what DjDT is capable of doing for you. I can’t imagine why anyone would not use this when developing with Django, unless it’s just plain ignorance of it.
Seriously, save yourself some headache when you are testing your work and use DjDT.
Bookmarked via Diigo on Saturday, November 14, 2009 @ 10:55 CST by Daniel Andrlik
Google has released their own programming language, appropriately named Go.
I haven’t had time to dig deeply into this yet, but I’m seeing some interesting stuff that I like such as fast compilation, garbage collection, easy to read syntax, built in support for multicore machines and of course an open source BSD-style license. I’m looking forward to playing around with this when I can free up some time to do so.
Bookmarked via Diigo on Wednesday, November 4, 2009 @ 08:02 CST by Daniel Andrlik
This is a sweet search application for Django.
When I first wrote my site, I had to patch the model code to have it utilize the native full text search available in PostgreSQL, and then some truly ugly search code for searching all the models in my applications. Haystack, combined with a true search backend like Solr or Xapian is a much better approach. Looks like a great way to implement robust search on your Django site.
Bookmarked via Diigo on Friday, April 10, 2009 @ 08:36 CDT by Daniel Andrlik
I love this post from John Gruber on how to block the DiggBar, and in effect, Digg itself. I’m also highly amused by the message he displays to users that try to access his site via the DiggBar.
There is already some Django middleware available for this that can be easily adapted to forward users to any custom view or external site you wish. I’ll definitely be setting this up on my site soon.
UPDATE: I decided to use frame-busting JavaScript instead since that takes care of Facebook and other sites that do framing as well. Like anything else it can be countered, but it’s a start.
Bookmarked via Diigo on Friday, February 27, 2009 @ 08:39 CST by Daniel Andrlik
This is a fascinating read by those of you who, like myself, are particularly interested in approaches to scaling applications at the database level. According to this post, FriendFeed has implemented a very interesting schema-less model for storing data within MySQL.
From the article:
As our database has grown, we have tried to iteratively deal with the scaling issues that come with rapid growth. We did the typical things, like using read slaves and memcache to increase read throughput and sharding our database to improve write throughput. However, as we grew, scaling our existing features to accomodate more traffic turned out to be much less of an issue than adding new features.
[snip]
Our datastore stores schema-less bags of properties (e.g., JSON objects or Python dictionaries). The only required property of stored entities is id, a 16-byte UUID. The rest of the entity is opaque as far as the datastore is concerned. We can change the “schema” simply by storing new properties.
We index data in these entities by storing indexes in separate MySQL tables. If we want to index three properties in each entity, we will have three MySQL tables - one for each index. If we want to stop using an index, we stop writing to that table from our code and, optionally, drop the table from MySQL. If we want a new index, we make a new MySQL table for that index and run a process to asynchronously populate the index without disrupting our live service.
As a result, we end up having more tables than we had before, but adding and removing indexes is easy. We have heavily optimized the process that populates new indexes (which we call “The Cleaner”) so that it fills new indexes rapidly without disrupting the site. We can store new properties and index them in a day’s time rather than a week’s time, and we don’t need to swap MySQL masters and slaves or do any other scary operational work to make it happen.
Make sure to read the article for a lot of design details, it is a very interesting approach to scaling.
Bookmarked via Diigo on Thursday, February 12, 2009 @ 22:39 CST by Daniel Andrlik
This is a pretty good summary of what’s going on with non-relational databases right now. There’s definitely some interesting things happening with them, and they are certainly easier to scale.
That being said, I wouldn’t go so far as to say that relational databases are doomed. The advantages of having a data store that automatically enforces integrity constraints, as well as the well-defined standards that allow developers to pick their poison with regards to database without having to alter their code base means that relational databases are going to remain compelling for small to medium projects, as well as large mission-critical applications for quite a while. Combine that with advanced database techniques such as sharding to help distribute relational databases across multiple servers, and I think relational databases will be around for some time to come.
That being said, non-relational databases could very well become the standard for cloud-computing applications, but they will need to settle on some common standard for development before it happens.
Bookmarked via Diigo on Saturday, December 13, 2008 @ 12:20 CST by Daniel Andrlik
Great tutorial and explanation on using ETags in Django for more efficient request processing. Part of an ongoing series on advanced HTTP concepts in Django by Malcolm Tredinnick.
Bookmarked via Diigo on Sunday, November 16, 2008 @ 09:32 CST by Daniel Andrlik
This is a great collection of Django tips. Worth reading through if you plan on doing any work with Django.