Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Making Money with Python
A while back a friend told me about something called community currency, also know as Local Exchange Trading System. The basic idea of which is that people within a geographical area can exchange goods and services with bespoke unit of exchange rather that traditional cash. So, for instance, you could mow a few lawns in exchange for guitar lessons – even if it isn't the guitar teacher's lawn you are mowing. There's no physical currency as such, members of the community currency rely on volunteers to keep track of how much currency they own. I think this is a marvellous idea. It promotes healthy exchanges without the need to muddy things with something as vulgar as cash. But what struck me after a bit of research is how the whole system is in dire need of mechanisation! There's no centralised place to view your ‘account’ or way to do transactions online, and I figured there should be. So that has been my hobby project for the last few months, I've been building such a site which has recently come together to a point where I'd like to gauge how much interest is out there. I haven't even come up with … -
Release 0.6.10
We just released LFS 0.6.10. This is a yet another bugfix release of the 0.6 branch. Changes Using django-postal 0.9 Bugfix: don't display non-active products within cart nor add them to order with checkout; adapt tests; fixed issue #154. Bugfix: don't delete OrderItems when a product is deleted. Information You can find more information and help on following locations: Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org and github. Google Group lfsproject on Twitter IRC -
mutt and gmail
-
limits.conf and daemons on Ubuntu
-
Most Important Changes in Django 1.4
With the announcement of Django 1.4RC2 and the final release of 1.4 around the corner I thought I’d go over some of the largest new features. For those that want to see the release notes you can do so here. QuerySet.select_for_update() Previously if you had to loop through a QuerySet and update the Models the only safe way was to do QuerySet.objects.filter().update(). If you looped through all the instances and called the individual Models.objects.save() you could potentially get a race condition where your save clobbers data saved between when you fetched it initially and when you were ready to save. Using QuerySet.select_for_update().filter() tells your Database to lock those rows until the transaction ends. This allows you to safely loop through the QuerySet modifying the Models as you wish. Model.objects.bulk_create() This method inserts the provided list of objects into the database in an efficient manner (generally only 1 query, no matter how many objects there are): >>> Entry.objects.bulk_create([ ... Entry(headline="Django 1.0 Released"), ... Entry(headline="Django 1.1 Announced"), ... Entry(headline="Breaking: Django is awesome") ... ]) QuerySet.prefetch_related() Another great addition to Django 1.4 is QuerySet.prefetch(). This behaves similarly to Django’s QuerySet.select_related() except for the fact that it does a separate lookup for each relationship … -
AJAX and Django Views
It seems that cleanly and easily doing AJAX views in Django is an area that gives a lot of people trouble. We like to do views as straight HTTP if at all possible, but there are always interactions that would be better served by not having a page load. We're also big fans of django-tastypie but it's a whole other ball of wax on its own, especially if you want to have views that write to the database. So, for the purposes of getting everyone up to speed doing AJAX with Django, we'll ignore Tastypie for now and just stick with ordinary views. Django automatic CSRF To start things off, put this bit of Javascript from the Django docs into a script that's loaded on all the pages where you'll be needing to perform AJAX views. This allows you to ignore the CSRF token for AJAX views, but it will be added as a request header. We previously said this could be seen as a security loophole and that same-origin came into effect. Both of these statements are wrong. AJAX & Form Field Errors Before we get to the Django side, there are a few small scripts that we recycle … -
Pagination
When you have a lot of data to sift through pagination is one of the best ways we have to visually breakup data so it is not as daunting. In this video we will use the Paginator built right into Django. It is much simpler than it sounds like it might be.Watch Now... -
Pagination
When you have a lot of data to sift through pagination is one of the best ways we have to visually breakup data so it is not as daunting. In this video we will use the Paginator built right into Django. It is much simpler than it sounds like it might be.Watch Now... -
Blog has moved
Blog has moved Thanks to some time at PyCon, I was finally able to move my blog off Wordpress and onto a new domain at: http://thegarywilson.com/ The new site is powered with an nginx / gunicorn / Django / PostgreSQL ... -
Blog has moved
Thanks to some time at PyCon, I was finally able to move my blog off Wordpress and onto a new domain at: http://thegarywilson.com/ The new site is powered with an nginx / gunicorn / Django / PostgreSQL stack. Using Wordpress' ... -
User-friendlier model forms
Recently, in our large client project, we had need of fields, in a model form, that accepted multiple types of input, but sanitized the data for the model. For example, the rent field, on the form, needs to handle a rent range (e.g. 900-1200), a single amount, or be overridden or extended by other bits of information, like "call for details" or "on approved credit". Obviously we don't want to have to parse this out every time we read the data. So, enter our fields that tear data apart and put it together every time it passes through. Model Let's go over our Rent model first. It's an abstract model so we can use it in multiple places (we have more than one logical model in the system that needs to deal with rent, this way we can use it multiple places without having to hold on to a huge amount of joins). We have several other abstract models that perform the same actions as our Rent model, but I won't show them here. from django.core.exceptions import ValidationError from django.db import models class Rent(models.Model): rent_low = models.PositiveIntegerField() rent_high = models.PositiveIntegerField(blank=True, null=True) rent_percent_income = models.FloatField(blank=True, null=True) rent_oac = models.BooleanField(default=False) rent_call_for_details = … -
Jinja Bootstrap (for Django!)
Hello comrades! I’m stoked to announce the launch of Jinja Boostrap: A library that brings Jinja2 templates and Twitter Bootstrap together. Put simply, Jinja Bootstrap gives you all of this Boostrap awesomness with just a few lines of Jinja template code. I use Bootstrap for all of my recent projects because it is beautiful, simple, consistent, and quick. For my Django projects, I use Jinja2 instead of the default Django templates. Jinja2 is far more powerful and robust. (And I use Jingo as the glue between Jinja2 and Django). I needed a way to use Bootstrap without re-adding all of the template tags, blocks, and macros that I needed. There’s where Jinja Bootstrap comes in. Benefits are as such: A base.html template to use as a base for your bootstrap projects Lots of blocks to make overriding easy Form field rendering macros Alert/message rendering macros If you want to try it out on your Bootstrap Django project, you can find setup instructions on the Jinja Boostrap GitHub page. Right now it supports Django fairly well. However, Jinja can be used with other platforms like Flask, Google App Engine, and Hyde. I’m hoping to expand this library to have full support … -
Front End Developer 2012 Summer Internship
I'm excited to announce that Caktus is looking for candidates for our front end developer/designer summer internship program. It is a 12 week paid position in our Carrboro, NC office. We're driving distance from UNC Chapel Hill, NC State Univeristy in Raleigh, and Duke in Durham, so students from all parts of the NC Research ... -
Launching our API at PyCon 2012
A few months ago me and my fiancee, Audrey Roy, launched our start up, Consumer Notebook. It's a Python powered product comparison site that combines the best features of Open Comparison, Yelp, Consumer Reports, and Pinterest. We've worked day and night to make it better, with countless members of the Python community using the site and giving us invaluable feedback. All of that brings us to PyCon. We're not just here as attendees and participants, but also to promote our startup. It used to be the cool thing to launch your startup at SXSW, but times have changed. Now it's the cool thing to launch at PyCon! Like Twilio, Twitter, Facebook, and Google, we've got an API we want developers to use. And as an upcoming startup, we've got to really be creative in how we gain your attention, so here is what we're doing for PyCon 2012: 1. Demos at our PyCon Startup Row booth. Thanks PyCon! We've got a booth on Saturday. We've got banners and bright red track jackets. We're giving out handy API reference cards, as well as 10 different flavors of Oreo cookies (see our site for a complete list of every Oreo cookie flavor, … -
Launching our API at PyCon 2012
A few months ago me and my fiancee, Audrey Roy, launched our start up, Consumer Notebook. It's a Python powered product comparison site that combines the best features of Open Comparison, Yelp, Consumer Reports, and Pinterest. We've worked day and night to make it better, with countless members of the Python community using the site and giving us invaluable feedback. All of that brings us to PyCon. We're not just here as attendees and participants, but also to promote our startup. It used to be the cool thing to launch your startup at SXSW, but times have changed. Now it's the cool thing to launch at PyCon! Like Twilio, Twitter, Facebook, and Google, we've got an API we want developers to use. And as an upcoming startup, we've got to really be creative in how we gain your attention, so here is what we're doing for PyCon 2012: 1. Demos at our PyCon Startup Row booth. Thanks PyCon! We've got a booth on Saturday. We've got banners and bright red track jackets. We're giving out handy API reference cards, as well as 10 different flavors of Oreo cookies (see our site for a complete list of every Oreo cookie flavor, … -
Security vulnerability announcement
This is an announcement of a security vulnerability of LFS. We are publishing multiple releases for all affected versions now. All users of LFS are urged to upgrade immediately. Versions affected 0.5.x, 0.6.x, 0.7.x Resolution Patches will be applied to the tip of all version branches. Releases for all affected versions will be provided. Installation The installation should be straightforward. Just replace your current version of django-lfs with the new release and restart your instance. This can be done in several ways dependend on your current installation. For instance you can just update the version of django-lfs within buildout.cfg and re-run the buildout or you can install a complete new instance and point it to your current database and media files. Make sure that you are using the correct version branch. You can find the different installers here: http://pypi.python.org/pypi/django-lfs/0.5.0 http://pypi.python.org/pypi/django-lfs/0.6.9 http://pypi.python.org/pypi/django-lfs/0.7.0b2 If you have questions, don't hesitate to get in contact: http://groups.google.com/group/django-lfs irc://irc.freenode.net/django-lfs security@getlfs.com If you need professional support, please look here: http://www.getlfs.com/service-providers Credit Thanks to Maciej Wisniowski (natcam.pl) who found the issue, handled it in a most responsible way and helped to provide the patches. General If you find a security relevant issue, please report it via private mail to security@getlfs.com. -
Caktus is Sponsoring Pycon 2012
Caktus is sponsoring Pycon 2012 in Santa Clara, CA this coming weekend! Nearly the entire office will be attending this year's event, which means Mark, Caleb, Calvin, David, Karen, Dan, Tobias, Colin, Julia, Nicole and I will be on site contributing and learning with the rest of the Python community. Nicole and I will be ... -
So long, djangosnippets, and thanks for all the fish
After two years of maintaining djangosnippets.org, I am pleased to announce that the guys from django-de are going to be taking over and you can expect to see some real improvements. Here is a quick list of things I was able to accomplish under my watch as well as the things I always meant to do but never got around to. Actually did Porting from ?? to modern django The version of djangosnippets I was handed had been written a number of years ago, early 2007 according to the whois record so I think it must have been django .96. The first thing I did was port the codebase to django 1.1. Search The full writeup can be found here, but tl;dr added solr, got many wins including search, "more like this", and ajax-y autocomplete. Discoverability One issue was discoverability -- many of the oldest snippets had the most upvotes or had been the most bookmarked, making it hard to find quality new code. I added date-based filtering to some of the list views to make it easier to find fresher content. Flagging The last thing I added was the ability for users to flag snippets as inappropriate or spam. … -
The sorry state of Python OAuth providers
This is one of those challenging posts to write. The people whose projects I'm going to describe have put in a lot of dedicated, hard work to overcome a challenging subject. Writing an OAuth consumer is a hard problem and writing an OAuth provider is an even harder problem. The efforts put in by the authors of these projects has been nothing short of incredible. The problem, however, is that the existing projects are not usable as-is, and need the support of the community in order to improve. The terrible thing is that this is a solved problem within our community. Python based projects are successfully implementing OAuth providers, and often using internally hacked versions of the efforts I'm about to describe. However, they aren't giving this back to the community. It might be that they want to protect their competitive edge, but I'm going to be nice and say that it's because their too busy to find time to send pull requests back. In any case, let me present our use case. For Consumer Notebook we want an API. We want to be able to track usernames, passwords, and the application using our API - which is the OAuth … -
The sorry state of Python OAuth providers
This is one of those challenging posts to write. The people whose projects I'm going to describe have put in a lot of dedicated, hard work to overcome a challenging subject. Writing an OAuth consumer is a hard problem and writing an OAuth provider is an even harder problem. The efforts put in by the authors of these projects has been nothing short of incredible. The problem, however, is that the existing projects are not usable as-is, and need the support of the community in order to improve. The terrible thing is that this is a solved problem within our community. Python based projects are successfully implementing OAuth providers, and often using internally hacked versions of the efforts I'm about to describe. However, they aren't giving this back to the community. It might be that they want to protect their competitive edge, but I'm going to be nice and say that it's because their too busy to find time to send pull requests back. In any case, let me present our use case. For Consumer Notebook we want an API. We want to be able to track usernames, passwords, and the application using our API - which is the OAuth … -
The Django community in 2012
In 2007, and again in 2009, I made an attempt to measure the size of the Django community. By popular request — okay, a couple people asked for it, whatever — let’s do this thing again. Users In 2007 and 2009, I shared three ways of looking at how many people are using Django: hits to the website, downloads of the Django tarball, and sites listed as “using Django.” So, here’s an overview of users, some notes on interpreting these numbers follow: -
Using LESS with Django
Lately, I’ve been working on creating a simplified work flow for my front end work here at Caktus. There are all sorts of new and helpful tools to optimize the creative process, allowing for faster iterations, and greater overall enjoyment. As with any new tool, there are a few options to choose from: LESS and ... -
Se buscan buenos programadores
Hi ha una frase que diu que "a Internet ningú saps que ets un ca". El mateix es pot dir actualment del llenguatge de programació que mou una plana o aplicació web, mentre la plana faci el que ha de fer, a l'usuari que l'està utilitzant no l'interessa el més mínim amb què està feta. Que avui en dia les planes acabin en php, asp, .do, no deixa de ser anecdòtic. Els bastiments de programació més moderns fins i tot amaguen amb què està feta la web a simple vista, a l'usuari no li cal la informació i potser estàs donant massa informació a algun visitant no desitjat. Aquest apunt ve arrel d'un post a bonillaware, titulat se buscan buenos programadores. El post és força intressant i l'oferta de feina crec que també, però allà faig una petita reflexió: no entenc com una companyia que va de cools pot fer un error tan de base com cercar bons programadors en un llenguatge concret. Bé, ho entenc si el que cerques no són bons programadors, sinó gent experimentada amb una tecnologia en concret. Vuit anys d'experiència no et converteixen en un bon programador en res. Si no has après el que … -
Release 0.7.0 beta 1
We just released LFS 0.7.0 beta 1. This is the next feature release of LFS. What's new? Added customer related taxes Added global image management Added django_compressor Added pluggable shipping price calculators Added pluggable order number generation Added calculation of base price Added product attachments Added more portlets: featured products, for sale products Aded SEO information for shop and pages Added portlets for pages Added type of quantity field Added context aware help for the management interface Improved pluggable product price calculators Improved pluggable payment processors Improved mails templates Information You can find more information and help on following locations: Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org and github. Google Group lfsproject on Twitter IRC -
Release 0.6.8
We just released LFS 0.6.8. This is a yet another bugfix release of the 0.6 branch. Changes Bugfix: fixed duplicate labels and invalid tags (Maciej Wisniowski) Bugfix: fixed calculation of topsellers when order items has no product (Maciej Wisniowski) Updated polish translations (Maciej Wisniowski) Updated german translations Information You can find more information and help on following locations: Documentation on PyPI Demo Releases on PyPI Source code on bitbucket.org and github. Google Group lfsproject on Twitter IRC