Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Pinax Tutorial at Pycon 2011
Tutorial Name: Pinax Solutions at Pycon 2011 (March 9th)This year I am yet again part of a two man team providing instruction on Pinax at Pycon. Last year's Long Pinax Tutorial went well, with myself and James Tauber receiving a lot of positive feedback plus some really good constructive criticism.Based off that criticism and our own experiences since last year's tutorial we decided to make some changes, specifically we wanted our class to be very solutions focused. Think of it as an organized brain dump of how best to start a project, leverage in the Pinax framework plus the rest of the Django ecosphere to do all that tedious make work we so dislike. Using these tools will let you focus on your project's unique attributes, meaning you get to focus on all the fun stuff!Another big change to the class is that Brian Rosner will be taking over in James' place as co-presenter (last year he was instrumental in reviewing the content of the class). Brian is a Django core committer, a Pinax core developer, the tech lead of Eldarion, and the steward of Gondor. If you like how the current Django admin works, you can thank him for his hard work. … -
January Mongo LA conference
Back in the mid-1990s my professional software development career started in relational databases. Periodically though I interacted with NoSQL databases. In 1999 I heard about ObjectStore. In 2003 I played with a few XML databases. With XML databases of the time, I found all you got out of them was a lot of complexity bolted onto a SQL based system. In 2006 I was introduced to ZODB, the Zope stack's object oriented database. ZODB has some fascinating traits, but the hard schemas used by Plone and Zope made it as rigid/stable as SQL systems but without as many useful tools. In 2008 I played a bit with Google's BigTable via appengine, where my impression was that of a relational database without indexes.Since then, a lot of new NoSQL solutions that have embraced the idea of schema-less architectures have presented themselves. I've glanced at them but until recently nothing on my plate really justified their use and taking the time to learn how to use them. Recently I've come across a project that justifies the whole document store approach used in systems like MongoDB, CouchDB, and others. However, because users of NoSQL tend to be such heavy kool-aid drinkers, I've been … -
Oficina Django no Campus Party
O Campus Party, maior evento de tecnologia do mundo, terá seu início na próxima semana em São Paulo. Segundo informações no site oficial, mais de 80 mil campuseiros já confirmaram presença. Não participei das edições anteriores, mas só de olhar a grade de programação, é possível imaginar o quanto se pode aprender com um evento como esse. Neste ano vou participar com uma oficina de Django, mostrando na prática o que se pode fazer com esse poderoso framework. Será uma oficina didática, mão na massa, pretendo criar uma aplicação simples, do zero, passando pelos principais recursos e facilidades. A oficina acontecerá no dia 21, sexta-feira, às 09:30h da manhã. Para mais informações, consulte a Grade Oficial do Campus Party. Conto com sua participação! O post Oficina Django no Campus Party apareceu primeiro em Christiano Anderson. -
Fastest "boolean SQL queries" possible with Django
For those familiar with the Django ORM they know how easy it is to work with and that you can do lots of nifty things with the result (QuerySet in Django lingo). So I was working report that basically just needed to figure out if a particular product has been invoiced. Not for how much or when, just if it's included in an invoice or not. [610 more words] -
Fastest "boolean SQL queries" possible with Django
For those familiar with the Django ORM they know how easy it is to work with and that you can do lots of nifty things with the result (QuerySet in Django lingo). So I was working report that basically just needed to figure out if a particular product has been invoiced. Not for how much or when, just if it's included in an invoice or not. [610 more words] -
Fastest "boolean SQL queries" possible with Django
For those familiar with the Django ORM they know how easy it is to work with and that you can do lots of nifty things with the result (QuerySet in Django lingo). So I was working report that basically just needed to figure out if a particular product has been invoiced. Not for how much or when, just if it's included in an invoice or not. [610 more words] -
Fastest "boolean SQL queries" possible with Django
For those familiar with the Django ORM they know how easy it is to work with and that you can do lots of nifty things with the result (QuerySet in Django lingo). So I was working report that basically just needed to figure out if a particular product has been invoiced. Not for how much or when, just if it's included in an invoice or not. [610 more words] -
Final days of the lenovo laptop
On my way home from the Dutch Django meeting, I'm sitting in the train to Utrecht. I take out my LAPTOP. OUCH. The dArn thINg is HOT again. The same as it was when I arrived at the Django meeting. Once every two weeks (since about three months) my lenovo laptop somehow wakes up again if I've suspended it. While sitting in my backpack! Why on earth?!? I'm sure it was sleeping some 5 seconds after I closed the lid. I mean, I'm checking that every time I put the laptop in my backpack since it happened the first time. Pretty irritating (and scaring) if you take a HOT laptop out of your bag. Why? No idea. Except that this is a cheapo lenovo thinkpad. Thinkpad? Didn't "IBM thinkpad" use to have legendary linux (which I'm using) support? Yes, it used to have. Until they brought out a cheaper line (the "SL510" model in my case) without the original thinkpad firmware. So with the thinkpad logo, but with some cheap, relatively unsupported, firmware. Just google for "thinkpad", "linux" and "speakers". Or "volume control". Or... My volume control doesn't work. My mute button doesn't work. The only thing that prevents me … -
Dutch Django meeting in Amsterdam, part two
Part two of the December Dutch django meeting. (See part one). Reusable django apps - Klaas van Schelven Basically a continuation of the lighting talk he gave last time. They make software for lawyers. These sites don't have lots of page views, so there are no performance issues, for instance. But the "problem" that they have is the amount of small customized changes that the customers want. One wants a social security number per person, the other wants to know the sex. They do not want to clutter the generic code with all those small customizations, however. You'd end up with lots of SHOW_SSN = False switches in your settings, otherwise. The official solution (*note Reinout: see James Bennett's video) is to "parametrize your views". def my_view(request, template="xyz", form_class=SomeForm, model_class=SomeClass). That's a whole whopping lot of parameters! System Message: WARNING/2 (<string>, line 21); backlink Inline emphasis start-string without end-string. Their solution: EightSpaces. "Class based everything", basically. It is called "eight spaces" as what you'd normally put in your models.py is indented eight spaces to the right: it is wrapped in two levels of eightspaces code: one wrapping class definition and one wrapper method. I've seen worse names :-) The wrapping … -
South and mutiple databases tests
Ok, today was the second time I was bitten by this. Time to write down the solution so I can find it back in google :-) The problem occurs when you have multiple databases, with the second one being just for one app. For example an existing database from the customer with some read-only data. So you probably have one app just for reading that data with a database router that allows only that app's models in that database. What happens when you have south enabled and you run the tests: $> bin/test ... Creating test database... Syncing... Creating table aaa Creating table bbb ... No fixtures found. Migrating... Running migrations for ccc: - Migrating forwards to 0001_initial. ... No fixtures found. Synced: > aaa > bbb Migrated: - ccc Creating test database 'the_second_database'... Syncing... Creating table ddd Creating table eee No fixtures found. Migrating... Traceback (most recent call last): ... django.db.utils.DatabaseError: no such table: south_migrationhistory Well, yes, that south_migrationhistory table doesn't exist in the second database. It doesn't need to be. When creating/migrating the databases (outside the tests), it all goes perfectly OK as only the default database is getting created/migrated. Only south in combination with tests fails as … -
Settings in Django
I want to talk a bit about how we handle our large amounts of application configuration over at DISQUS. Every app has it, and it seems like theres a hundred different ways that you can manage it. While I'm not going to say ours is the best way, it has allowed us a very flexible application config... -
Settings in Django
-
The First Few Weeks - ep.io
The First Few Weeks—ep.io. Another take on managed Python Django/WSGI hosting, from Andrew Godwin and Ben Firshman. -
Hello from Gondor
Hello from Gondor. “Effortless production Django hosting” from the Eldarion team. -
Creating a PostgreSQL User and Database
Coming Soon. -
Running mod_wsgi in Daemon Mode
If you are tired of having to reload Apache each time you make a change to the Python files in Django then read on. There is a way around this and it is done by using mod_wsgi and running it in daemon mode which allows you to touch the WSGI file and have Apache automatically pick up on the changes you have made without having to restart. All you need to do is add the... -
Running mod_wsgi in Daemon Mode
If you are tired of having to reload Apache each time you make a change to the Python files in Django then read on. There is a way around this and it is done by using mod_wsgi and running it in daemon mode which allows you to touch the WSGI file and have Apache automatically pick up on the changes you have made without having to restart. All you need to do is add the... -
New Ventures
For the past month and a bit, I've been working part-time on my new venture.Along with Ben Firshman, I'm working on ep.io, a Python/WSGI hosting service, with resource-based (not instance-based) billing. It's been an interesting ride - designing shared hosting so it's both secure and so you can measure and bill resources accurately is a difficult task - but we're finally out of the woods and have everything working reasonably normally, leaving only the slow crawl of beta-testing and polishing (and working out a payment provider). We've also launched a blog, which only contains an initial post now, but it's where we'll be noting down what we've learnt, and general deployment advice, hopefully making it useful as a general learning resource as well as a corporate mouthpiece. Initially we've focused on supporting Django, as it's the thing Ben and I use most often, but the entire stack was built with general WSGI applications in mind (and, indeed, they do run). The stack we've built is quite flexible, so it could potentially be used for a variety of different languages or frameworks, but we think focusing on doing Python (and doing it well) is a good goal. If you want to … -
New Ventures
For the past month and a bit, I've been working part-time on my new venture. Along with Ben Firshman, I'm working on ep.io, a Python/WSGI hosting service, with resource-based (not instance-based) billing. It's been an interesting ride - designing shared hosting so it's both secure and so you can measure and bill resources accurately is a difficult task - but we're finally out of the woods and have everything working reasonably normally, leaving only the slow crawl of beta-testing and polishing (and working out a payment provider). We've also launched a blog, which only contains an initial post now, but it's where we'll be noting down what we've learnt, and general deployment advice, hopefully making it useful as a general learning resource as well as a corporate mouthpiece. Initially we've focused on supporting Django, as it's the thing Ben and I use most often, but the entire stack was built with general WSGI applications in mind (and, indeed, they do run). The stack we've built is quite flexible, so it could potentially be used for a variety of different languages or frameworks, but we think focusing on doing Python (and doing it well) is a good goal. If you want … -
django-static version 1.5 automatically taking care of imported CSS
I just released django-static 1.5 (github page) which takes care of optimizing imported CSS files. To explain, suppose you have a file called foo.css and do this in your Django template: {% load django_static %} <link href="{% slimfile "/css/foo.css" %}" rel="stylesheet" type="text/css" /> And in foo.css you have the following: @import "bar.css"; body { background-image: url(/images/foo.png); } And in bar.css you have this: div.content { background-image: url("bar.png"); } The outcome is the following: # foo.css @import "/css/bar.1257701299.css"; body{background-image:url(/images/foo.1257701686.png)} # bar.css div.content{background-image:url("/css/bar.1257701552.png")} In other words not only does it parse your CSS content and gives images unique names you can set aggressive caching headers on, it will also unfold imported CSS files and optimize them too. I think that's really useful. You with one single setting (settings.DJANGO_STATIC=True) you can get all your static resources massaged and prepare for the best possible HTTP optimization. Also, it's all automated so you never need to run any build scripts and the definition of what static resources to use (and how to optimize them) is all defined in the template. This I think makes a lot more sense than maintaining static resources in a config file. The coverage is 93% and there is an example app to look at in the if you prefer that over a README. -
django-static version 1.5 automatically taking care of imported CSS
I just released django-static 1.5 (github page) which takes care of optimizing imported CSS files. To explain, suppose you have a file called foo.css and do this in your Django template: {% load django_static %} <link href="{% slimfile "/css/foo.css" %}" rel="stylesheet" type="text/css" /> And in foo.css you have the following: @import "bar.css"; body { background-image: url(/images/foo.png); } And in bar.css you have this: div.content { background-image: url("bar.png"); } The outcome is the following: # foo.css @import "/css/bar.1257701299.css"; body{background-image:url(/images/foo.1257701686.png)} # bar.css div.content{background-image:url("/css/bar.1257701552.png")} In other words not only does it parse your CSS content and gives images unique names you can set aggressive caching headers on, it will also unfold imported CSS files and optimize them too. I think that's really useful. You with one single setting (settings.DJANGO_STATIC=True) you can get all your static resources massaged and prepare for the best possible HTTP optimization. Also, it's all automated so you never need to run any build scripts and the definition of what static resources to use (and how to optimize them) is all defined in the template. This I think makes a lot more sense than maintaining static resources in a config file. The coverage is 93% and there is an example app to look at in the if you prefer that over a README. -
django-static version 1.5 automatically taking care of imported CSS
I just released django-static 1.5 (github page) which takes care of optimizing imported CSS files. To explain, suppose you have a file called foo.css and do this in your Django template: {% load django_static %} <link href="{% slimfile "/css/foo.css" %}" rel="stylesheet" type="text/css" /> And in foo.css you have the following: @import "bar.css"; body { background-image: url(/images/foo.png); } And in bar.css you have this: div.content { background-image: url("bar.png"); } The outcome is the following: # foo.css @import "/css/bar.1257701299.css"; body{background-image:url(/images/foo.1257701686.png)} # bar.css div.content{background-image:url("/css/bar.1257701552.png")} In other words not only does it parse your CSS content and gives images unique names you can set aggressive caching headers on, it will also unfold imported CSS files and optimize them too. I think that's really useful. You with one single setting (settings.DJANGO_STATIC=True) you can get all your static resources massaged and prepare for the best possible HTTP optimization. Also, it's all automated so you never need to run any build scripts and the definition of what static resources to use (and how to optimize them) is all defined in the template. This I think makes a lot more sense than maintaining static resources in a config file. The coverage is 93% and there is an example app to look at in the if you prefer that over a README. -
django-static version 1.5 automatically taking care of imported CSS
I just released django-static 1.5 (github page) which takes care of optimizing imported CSS files. To explain, suppose you have a file called foo.css and do this in your Django template: {% load django_static %} <link href="{% slimfile "/css/foo.css" %}" rel="stylesheet" type="text/css" /> And in foo.css you have the following: @import "bar.css"; body { background-image: url(/images/foo.png); } And in bar.css you have this: div.content { background-image: url("bar.png"); } The outcome is the following: # foo.css @import "/css/bar.1257701299.css"; body{background-image:url(/images/foo.1257701686.png)} # bar.css div.content{background-image:url("/css/bar.1257701552.png")} In other words not only does it parse your CSS content and gives images unique names you can set aggressive caching headers on, it will also unfold imported CSS files and optimize them too. I think that's really useful. You with one single setting (settings.DJANGO_STATIC=True) you can get all your static resources massaged and prepare for the best possible HTTP optimization. Also, it's all automated so you never need to run any build scripts and the definition of what static resources to use (and how to optimize them) is all defined in the template. This I think makes a lot more sense than maintaining static resources in a config file. The coverage is 93% and there is an example app to look at in the if you prefer that over a README. -
Docs or it doesn't exist
Docs or it doesn't exist -
Introducing Shrubbery
Shrubbery is a collection of utilities for and extensions of Django. Its core feature are: App-local settings ORM extensions: fields, managers & querysets, multiple joins, and arbitrary queryset unions Polymorph relations (a replacement for django.contrib.contenttypes) A tagging app build on top of polymorph relations. I plan to describe most of these in detail in future posts. Meanwhile, there is some documentation. Shrubbery requires Django 1.3. It is available under the MIT License on github.