Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Comparison between Django, Rails and Grails.
-
Office hours
Frank and I held our first Revsys “office hours” this past Friday, November 5th. We’ve taken the IRC transcript, organized and cleaned it up a bit, and posted it online for those who couldn’t make it. We had about fifty people show in IRC where they asked questions on a wide variety of topics including deployment, NoSQL, cloud computing, and contributing to Django. It was a blast! A few of my favorite questions: -
Release classifiers in distutils/pypi
Thanks to Doug Napoleone I'm now aware there is already a convention followed for the python and framework versions, but it appears that not enough people are aware of it. This post is pretty much a reposting of the second comment of the post immediately preceding this one and Doug gets full credit for this post. I'm just repeating his message:The release classifiers in this post should be included in the standard distutils documentation. For the moment, you can see the full list of classifiers here:http://pypi.python.org/pypi?%3Aaction=list_classifiersFor the python language version the classifier is:Programming Language :: Python :: x.y.zWith each version on it's own line. That way you can browse the repository by python version (see the bottom of the page):http://pypi.python.org/pypi?:action=browse&c=214There is also support for frameworks which you can see on that page as well. There it is done with:Framework :: Django :: x.y.zThere is Zope, Plone, and a number of other frameworks already there.In the example you gave the proper, and supported way of writing the metadata is:Programming Language :: PythonProgramming Language :: Python :: 2.4Programming Language :: Python :: 2.5Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Framework :: DjangoFramework :: Django :: 0.96Framework :: Django :: … -
A request for new pypi classifiers
This request is to help enhance Django Packages, PyPM Index, and other projects. This would also help the Python community at large.Would it be possible that a standard be established for listing in PyPI classifiers which versions of a package is known to operate? Using James Bennett's django-registration at http://pypi.python.org/pypi/django-registration as an example (see my bolded, last two lines to understand what I'm trying to demonstrate):Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: UtilitiesPython Versions :: 2.4, 2.5, 2.6, 2.7Django Versions :: 0.96, 1.0, 1.1, 1.2.1, 1.3The metadata system I'm writing about in this blog post is specified on the distutils documentation page.I picked a Django package but this could be for Zope, Pyramid, PyQT, or anything.If we had something like this in place then people could quickly identify on PyPI and other resources if a tool can be of use to them or if it needs to be updated to the latest code base. If this already exists, then can someone point me at the existing specification so I can promote it?Edit: Noah Kantrowitz suggested I take a look at … -
Little tip on how to reset ipdb
When I code Django, I leave a server running in a Linux shell. python manage.py runserver Sometimes when I use ipdb to debug some code, the screen input disappears and I can not see what I’m typing. Rather than ^C the server, I prefer to fix the problem. You just need to reset the screen: import os os.system('reset') -
Two new Django classes: deployment and the ecosystem
Want to buff up your Django chops? Learn some cool new tricks for the new year? You should come to one of my new Django classes next month! I'll be teaching two new one-day classes, both of which evolved from common questions we get here at Revsys. Each class is going to be offered twice, once in LA and once in Boston. For the impatient here are some links and quick info: Django Deployment Workshop - Los Angeles - December 6, 2010. Django Deployment Workshop - Boston - December 10, 2010. The Best of the Django Ecosystem - Los Angeles - December 7, 2010. The Best of the Django Ecosystem - Boston - December 9, 2010. For more details on each class, read on... The first class attempts to answer this question: "So... I've written this cool Django site, and it works on my laptop... but now what?" We've increasingly been spending our time helping clients learn how to successfully deploy Django, so I've taken the things we've learned and turned them into the Django Deployment Workshop. You're invited to bring your own Django sites and I'll show you how to put them into production. At the end of the … -
Django classes: deployment, ecosystem
(Cross-posted from the Revsys blog; I think folks here might be interested, too.)Next month I’ll be teaching two new one-day classes, both of which evolved from common questions we get at Revsys. Each class is going to be offered twice, once in LA and once in Boston. For the impatient here are some links and quick info: Django Deployment Workshop - Los Angeles - December 6, 2010. Django Deployment Workshop - Boston - December 10, 2010. -
How to roast a chicken
Look, people, cooking isn’t hard. Some recipes are hard, but really most of the best, classic dishes are as easy as pie [1]. Take a nice roast chicken. It’s showy – whole birds look fantastic – and just about the easiest thing in the world. With a tiny bit of attention to detail you can crank out a delicious meal that’ll knock people’s socks off. If you want to really sound impressive, tell people that the recipe is from Thomas Keller – chef-owner of The French Laundry, one of the best restaurants in the country [2]. -
SEOmoz meetup in Sofia, Bulgaria
First of all I want to thank to Rand Fishkin from SEOmoz and the Webit team for organizing this meetup. For a long time in the web world there was a feud between the developers and the SEO guys. Both groups claiming that their work is more important, more sophisticated and with bigger value to [...] -
Open "Office Hours"
We've been wanting to try this for awhile, but have been too busy to actually try it out until now. Jacob Kaplan-Moss and I will be holding open "office hours" this Friday November 5th between 1-3 PM CDT in IRC. Come join us in #revsys on freenode and pick our brains. Or just come to listen and learn. The concept is pretty simple, Jacob and I (and likely many other knowledgeable Djangonauts) will be in the channel and attempt to answer your questions related to: Django/Python Deployment Scaling/Performance PostgreSQL Anything else we happen to know... We're going to log the discussion and will provide a transcript online afterwards. Update: The transcript is now available. -
Django gotcha: concrete inheritance
Since 1.0, Django’s supported model inheritance. It’s a neat feature, and can go a long way towards increasing flexibility in your modeling options. However, model inheritance also offers a really excellent opportunity to shoot yourself in the foot: concrete (multi-table) inheritance. If you’re using concrete inheritance, Django creates implicit joins back to the parent table on nearly every query. This can completely devastate your database’s performance. To refresh, if you’ve got models like: -
Search on djangosnippets.org
Users of djangosnippets.org may have noticed the addition of a few search-related features over the past several months. I'd like to highlight some of the additions that have been made and show how you can implement similar functionality on your sites. All of djangosnippet's search leans on Apache Solr, a powerful search engine built on top of Apache Lucene. Haystack is the search solution for Django apps - it provides a querying interface similar to Django's ORM, handles indexing your models for you, and supports advanced features like "more-like-this" and faceting. Getting set up (angle brackets, anyone?) I've actually written another post on setting up multi-core Solr on Ubuntu 10.04. I got a bit of flak for using tomcat6 as the server - you can definitely go with jetty instead. Jetty is bundled with Solr, check out the examples/README.txt to get started quickly. You might find the following links useful: Installing Solr Apache Solr + Jetty Apache Solr + Tomcat6 When setting up search with haystack, there are two important configuration files to be aware of: schema.xml solrconfig.xml schema.xml The Solr schema is only superficially analagous to a database schema (if your database was just one big freaking table). It … -
What's your favorite Django app?
On Twitter, I asked, “what’s your favorite third-party Django app?” Eight hours later, I’ve got about 50 replies. I meant the question to be fairly open-ended – I deliberately didn’t clarify what I meant by “favorite” – and I’m not that popular, so this is by no means an accurate sample of the Django community. Still, the answers are a bit interesting, so let’s take a look: The winners The favorite was… (drumroll please)… South. -
Using web-based image editors with Django apps
Intergrating FotoFlexer, Picnik and Pixlr web based image editors with Django applications -
Python: Virtualenv + pip
"In the Java world there was always a problem with dependencies. All the jars we had to mange by hand – quite awful. Thankfully there is a Maven project which helps us in requirements management. But what about Python? Is there any way to handle necessary libraries? Of course, there is! It is a tandem of virtualenv and pip." by Marcin Swierczynski -
Global Django Permissions
Django has a great solution for web site permissions, it allows the developer to decide how a user can interact with an application based on permissions against models (i.e. database tables). By default a model comes with three permissions, add, change and delete. If these aren’t enough then you can create as many custom model [...] -
Django-qsstats, parce qu’en vrai,on adore tous faire des stats.
Ce mois-ci, j'aurais pu écrire plusieurs django-app du mois. Si j'avais eu le temps. Mais bon, le jour où j'aurais le temps, ça se saura. Du coup, alors que l'horloge tourne et qu'il ne me reste plus qu'un jour et demi pour écrire ma django app du mois et mon polargeek, j'ai décidé d'écrire ... -
Gràcies a tots per venir al creant bits: eines
Actualització: Pujats els documents al dropbox Presentació d'eines Presentació Git Una vegada més, i ja van quatre el creantbits ens ha servit per carregar piles, per trobar-nos amb amics que feia temps que no veiem. Cares conegudes d'altres trobades (des d'aquí moltes gràcies per el detall de les galletes) i un quòrum impressionant. Se nota que en Pau té tirada :) Feia estona que volíem fer una altra trobada d'aquestes. Personalment crec que és molt enriquidora pel que representa d'important per nosaltres veure que hi ha molta més gent que s'interessa pel mateix tipus de coses que nosaltres. Com ja he dit altres vegades això me fa tornar la fe amb la professió. M'hagués agradat poder fer streaming de vídeo, l'hem intentant, però ens ha fallat la connexió. Ja sé que estam a un Parc tecnològic, però ja sabeu com van aquestes coses. A APSL necessitàrem prop de tres mesos en tenir una ADSL i és sols de les normaletes (i cares), res de connexions de 50 Mb que hi ha pels pobles. A veure si la propera vegada hi ha més sort! Com a telonero de Pau he presentat un grapat d'eines que trob d'allò més interessants per fer … -
uWSGI and Django Secure Requests
A colleague and I ran into a frustrating situation this evening when transitioning a site from Apache and mod_wsgi to uWSGI. Django's request.is_secure() wasn't working correctly. After much Googling and shouting at the SSH console, we finally discovered the UWSGI_SCHEME uWSGI parameter. To fix the issue, we edited /etc/nginx/uwsgi_params (which originally comes from nginx/uwsgi_params in the uWSGI tarball) and added an additional param at the bottom: uwsgi_param UWSGI_SCHEME $scheme; This prompts uWSGI to set wsgi.url_scheme to the appropriate value, which Django then detects in the wsgi handler. I'd really love to see this in the documentation on the uWSGI site, or (even better) included by default in the uwsgi_params in the tarball. In the meantime, though, it's a relatively quick and easy fix. Enjoy! -
"Web Scale"
Christophe Pettus: What does [“web scale”] mean? It clearly means something along the lines of, “Can handle lots of transactions per unit time,” but how many? I mean, WordPress with WP-SuperCache is “web scale” if all that is meant is, “Can be used to implement a high volume site,” but I assume those who are touting something as “web scale” are aiming higher than that. Anyone care to offer a quantitative definition of this term? -
In Django, how much faster is it to aggregate?
Being able to do aggregate functions with Django's QuerySet API is really useful. Not because it's difficult to write your own loop but because the summation is then done inside the SQL database. I had this piece of code: t = Decimal('0') for each in some_queryset: t += each.cost Which can be rewritten like this instead: t = qs.aggregate(Sum('cost'))['cost__sum'] For my 6,000+ records in the database the first one takes about 0.7 seconds. The aggregate takes 0.02 seconds. Blimey! That's over 30 fold difference in speed for practically the same thing. Granted, when doing the loop you can do some other stuff such as counting or additional function calls but that difference is quite significant. In my current application those 0.7 seconds isn't really a problem but it quickly becomes when it has to be done over and over for multiple sets. -
In Django, how much faster is it to aggregate?
Being able to do aggregate functions with Django's QuerySet API is really useful. Not because it's difficult to write your own loop but because the summation is then done inside the SQL database. I had this piece of code: t = Decimal('0') for each in some_queryset: t += each.cost Which can be rewritten like this instead: t = qs.aggregate(Sum('cost'))['cost__sum'] For my 6,000+ records in the database the first one takes about 0.7 seconds. The aggregate takes 0.02 seconds. Blimey! That's over 30 fold difference in speed for practically the same thing. Granted, when doing the loop you can do some other stuff such as counting or additional function calls but that difference is quite significant. In my current application those 0.7 seconds isn't really a problem but it quickly becomes when it has to be done over and over for multiple sets. -
In Django, how much faster is it to aggregate?
Being able to do aggregate functions with Django's QuerySet API is really useful. Not because it's difficult to write your own loop but because the summation is then done inside the SQL database. I had this piece of code: t = Decimal('0') for each in some_queryset: t += each.cost Which can be rewritten like this instead: t = qs.aggregate(Sum('cost'))['cost__sum'] For my 6,000+ records in the database the first one takes about 0.7 seconds. The aggregate takes 0.02 seconds. Blimey! That's over 30 fold difference in speed for practically the same thing. Granted, when doing the loop you can do some other stuff such as counting or additional function calls but that difference is quite significant. In my current application those 0.7 seconds isn't really a problem but it quickly becomes when it has to be done over and over for multiple sets. -
In Django, how much faster is it to aggregate?
Being able to do aggregate functions with Django's QuerySet API is really useful. Not because it's difficult to write your own loop but because the summation is then done inside the SQL database. I had this piece of code: t = Decimal('0') for each in some_queryset: t += each.cost Which can be rewritten like this instead: t = qs.aggregate(Sum('cost'))['cost__sum'] For my 6,000+ records in the database the first one takes about 0.7 seconds. The aggregate takes 0.02 seconds. Blimey! That's over 30 fold difference in speed for practically the same thing. Granted, when doing the loop you can do some other stuff such as counting or additional function calls but that difference is quite significant. In my current application those 0.7 seconds isn't really a problem but it quickly becomes when it has to be done over and over for multiple sets. -
Diapositivas del taller Django en Nicaragua
Estas son las diapositivas del taller sobre Django que impartió ayer Adolfo Fitoria en Nicaragua.