Django community: RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
A year looking back, and looking forward
I'm not big into resolutions. I've only had it work one year, and that was because my resolution was to go on a cruise. That's not exactly the most strenuous goal to work towards, is it? I still like the end of the year, though, for a chance to look ... -
django-celery, eventlet and debugging blocking
-
Realtime Postfix stats aggregator
-
Class-based views in Django 1.3
Django class-based views Introduction Django 1.3 added class-based views, but neglected to provide documentation to explain what they were or how to use them. So here's a basic introduction. Example of a very basic class-based view Let's start with an example of a very basic class-based view. urls.py: ... url(r'^/$', MyViewClass.as_view(), name='myview'), ... views.py: from ... -
Class-based views in Django 1.3
Django class-based views Introduction Django 1.3 added class-based views, but neglected to provide documentation to explain what they were or how to use them. So here's a basic introduction. -
Class-based views in Django 1.3
Django class-based views Introduction Django 1.3 added class-based views, but neglected to provide documentation to explain what they were or how to use them. So here's a basic introduction. Example of a very basic class-based view Let's start with an example of a very basic class-based view. urls.py: ... url(r'^/$', MyViewClass.as_view(), name='myview'), ... views.py: from ... -
Class-based views in Django 1.3
Django class-based views Introduction Django 1.3 added class-based views, but neglected to provide documentation to explain what they were or how to use them. So here's a basic introduction. Example of a very basic class-based view Let's start with an example of a very basic class-based view. urls.py: ... url(r'^/$', MyViewClass.as_view(), name='myview'), ... views.py: from ... -
OpenBlock Geocoder, Part 3: External Geocoders
The OpenBlock geocoder is powerful and robust. It uses PostGIS for spacial queries, can extract addresses from bodies of text, and can understand block and intersection notation. We've run into a few issues with it, however, including a low geocoding success rate. This is a tough problem to solve and depends on a lot of ... -
OpenBlock Geocoder, Part 3: External Geocoders
The OpenBlock geocoder is powerful and robust. It uses PostGIS for spacial queries, can extract addresses from bodies of text, and can understand block and intersection notation. We've run into a few issues with it, however, including a low geocoding success rate. This is a tough problem to solve and depends on a lot of ... -
OpenBlock Geocoder, Part 3: External Geocoders
The OpenBlock geocoder is powerful and robust. It uses PostGIS for spacial queries, can extract addresses from bodies of text, and can understand block and intersection notation. We've run into a few issues with it, however, including a low geocoding success rate. This is a tough problem to solve and depends on a lot of ... -
OpenBlock Geocoder, Part 3: External Geocoders
The OpenBlock geocoder is powerful and robust. It uses PostGIS for spacial queries, can extract addresses from bodies of text, and can understand block and intersection notation. We've run into a few issues with it, however, including a low geocoding success rate. This is a tough problem to solve and depends on a lot of factors (the extent of street and block data in OpenBlock, format of the street addresses, etc.), so your mileage may vary. Below I constructed a simple test using Google's Geocoding API to have as an alternative. -
Quick Optional Model Fields Trick
This is just something I do now. It’s DRY, saves a few keystrokes, helps stay under pep8’s 79 character limit, and improves readability in my opinion. http://gist.github.com/1526444 -
Django Caching in the Real World: Part 1
When you develop a sizable content heavy web site you quickly learn, hopefully not the hard way, that caching is a very important piece of your infrastructure. The database servers are the typical bottleneck in high volume website. In this series, we’ll explore the a caching strategy we recently implemented. -
Resum del 2011
Ara que ja estam a punt d'acabar el 2011 faré el que toca fer per aquestes dates no és més que fer un resum de l'any que acaba i fer un poc d'avançament del que esper en el 2012. Com bé sabeu, darrerament per mi parlar d'informàtica i feina és parlar d'APSL, el projecte que iniciàrem fa uns anys amb un grapat de socis, parlar de Python, de Django i de GNU-Linux. APSL El febrer de 2012 ja farà tres any de la posada en marxa del projecte APSL, que per qui no ho sap és l'acrònim d'Advanced Programming Solutions SL. El nom el pensarem a un dinar entre en Bernat, en Xus i jo mateix, a partir d'un domini de quatre lletres que vaig poder comprar gairebé de casualitat. Primer va ser el domini i després va ser el nom. Ara no record ben bé qui va proposar la versió final, però record clarament que en parlàvem amb Xus. Sigui com sigui enguany ha suposat passar dels 2 membre amb que iniciàrem el 2010 a passar a quatre i tenir que canviar d'oficina, passant de la incubadora del Parc Bit a un despatx compartit a l'edifici NTIC del mateix … -
Release 0.6.2
We just released LFS 0.6.2. This is a bugfix release. Following bugs have been fixed: fixed issue with utf-8 support for MySQL; issue #126 fixed product filtering; issue #124 LFS goes Github We have setup a Github mirror of LFS. So if you feel more comfortable with Github then check it out. Information You can find more information and help on following locations: Official page Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org and github. Google Group lfsproject on Twitter IRC -
My Django 1.4 Project Template
Django supports custom project templates as of 1.4. This is a feature i’ve been dreaming for and since have created what I consider - and hope - is an improved project template for most. https://github.com/amccloud/django-project-skel/ Changes and additions Global templates, static, and fixtures directory. Collects static and media into public/{static,media} respectively. Django admin activated by default. Django timezone setting changed to UTC for sanity. HTML 5 base template with simple 404 and 500 error templates. Discourages storing credentials and secrets in the repository. Encourages the use of local_settings.py and accompanying __local_settings.py template. Encourages the use of virtualenv and virtualenvwrapper. Encourages the use of pip and requirements.txt. Encourages the use of git. Includes a .gitignore for the usual junk. Automatically builds a README with installation notes. How to use django-admin.py startproject --template https://github.com/amccloud/django-project-skel/zipball/master --extension py,md yourprojectname Contribute on GitHub -
One of the Biggest Mistakes Django Developers Make When Using Lettuce
This post is the first in a series of posts about best practices when using Lettuce, a testing framework for Django. When I first released Lettuce, a framework for writting automated tests in Django with user stories, I had no idea that it would have become so widely used. It’s been truly amazing to have seen it expand from Brazil to the United States to China and many other countries. It’s even been translated into 15 languages. However, over the last 6 months, I’ve observed a common usage that, for the reasons below, developers should avoid. Steps from Step Definition Like Cucumber, Lettuce supports calling other steps from a step definition. This can be a very handy functionality, but can easily become a source of code that is hard to maintain. So why is this functionality available? Although Lettuce is a testing tool, step.behave_as was a patch that was incorporated in the codebase without complete test coverage. step.behave_as causes a step to call many others by parsing the text and calling them synchronously and sequentially. Some people like to use this functionality in order to make their scenario look leaner, which is fine. The actual problem is that this workflow … -
Starter fabfile and scripts for a Django project on Webfaction
A quickstart for deploying a Django project to a shared hosting system like WebFaction. -
New Year’s Python Meme
I love these blog memes, so I give you my version of Tarek Ziade's New Year's Python Meme.1. What’s the coolest Python application, framework or library you have discovered in 2011?For python libraries, that would have to be Kenneth Reitz' python-requests library. I've used it for an amazing amount of stuff and blogged about it. It took the grunge out of doing HTTP actions with Python. The API is clean and elegant, getting out of your way. It embodies the State of the art for API design, which closely matches the Zen of Python.For applications, djangolint.com is awesome. It has helped me out so much on several projects. I would love to see something like this implemented and maintained for modern Python.All the Python friendly PaaS efforts that have emerged are changing the landscape for those of us who want to launch projects but don't want to become full time system administrators in the process. Heroku, DjangoZoom, DotCloud, ep.io, gondor.io, and others are making it possible for developers to focus on development not server tooling. Google App Engine paved the way and it is wonderful to see the rest of the universe catch up with material that more closely follow … -
django-statsd
A while ago Jeff Balogh and James Socol got statsd and graphite running for web development projects at Mozilla. They wrote some great code including pystatsd and commonware. This allows us at a glance to see what's going on in AMO and SUMO and whole host of other projects. Since then graphite has become a key part of our process. I can't imagine running a large site without it. I started playing around with some tighter integration between Django and pystatsd a while back. That resulted in a pull request to pystatsd which James didn't want, he wanted to keep pystatsd Python only. Made sense, so then I wrote django-statsd which provides some optional deeper integration between Django and statsd. To install add in INSTALLED_APPS: django_statsd You can now choose your client by configuring settings.py. By default statsd will send UDP packets on your development box. To turn that off use a null client, for example: STATSD_CLIENT = 'django_statsd.clients.null' You'd use django_statsd.clients.normal on your production boxes, or anything you want to measure. This library includes a few useful ways of sending timings. I pulled the middleware out of the afore mentioned commonware (credit to James and Jeff for that) so … -
Function caching decorator
Every once in a while, you have to create a function in one of your models, that does a lot of queries. If you use that function a couple of times, you might find it a wise thing to 'cache' the function. A 'cached' function will look like this: def get_important_data(self): if not hasattr(self, _important_data): self._important_data = self.get_result_of_lots_of_queries() return self._important_dataIf you call this function once on an object, it will run a lot of queries, but will store the result in self._important_data. The next time you call the function on this exact same object, the attribute self._important_data will still be set and the huge load of queries do not have to be executed again.In some projects you have to create such a function more than once, for whatever reason. A colleague got sick and tired of writing the same code over and over again and came up with an idea to tackle this concurrency. So he asked me if, when I had little to do, I could write a decorator that does exactly the same kind of 'caching' as the function above. I however have little to no experience in writing decorators, so I copy/pasted something together from the interwebz, … -
IP Street will consider more than three Django developers
My Senior Developer job description had an embarrassing mistake. It asked for 7+ years experience in Python and Django, which, as a commenter noted, limited the candidate pool to about three people on the entire planet. I’ve fixed my goof. We’re nominally looking for at least seven years of Python experience, and at least three years of Django experience, for this slot. Tagged: Django, jobs -
Django powered Christmas Card
Merry Christmas -
Forms Part 1: Raw Forms
Forms are generally a pain to deal with when doing sites. This is the first video in a series to help make forms in django easier to do and understand. We start with doing raw forms and not using any of the django helpers so we can understand what the helpers are doing in the future.Watch Now... -
Forms Part 1: Raw Forms
Forms are generally a pain to deal with when doing sites. This is the first video in a series to help make forms in django easier to do and understand. We start with doing raw forms and not using any of the django helpers so we can understand what the helpers are doing in the future.Watch Now...