Django community: Community blog posts RSS
This page, updated regularly, aggregates Community blog posts from the Django community.
-
Lessons Learned from a Django Deployment
This website was built with Django 1.2.4, and is hosted by Webfaction.com. Webfaction is easy to set up, and if you are not a deployment expert (i.e. you are not Jacob Kaplan-Moss) that’s what you should use. I followed James Bennet’s book some of the way. It has a few errors in the code and it is a little dated, but it helped me as a beginner. You can find it here. Use django-taggit django-tagging is kind of dead, and Alex Gaynor (who is probably the most productive programmer who can’t buy alcohol legally in the US) has made a better and more extensible alternative: django-taggit. It actually has a couple of extensions and it’s on Eric Holscher’s Read the Docs here. Pay attention to which Python Version you are using Webfaction (like just about every computer) has multiple versions of python installed, and one (usually not the one you want) will be used when you type “python” To use the one you want, say 2.6, you either type “python2.6” every time, or you add this line to your ~/.bash_profile (create it if it’s not there): 1 alias python=python2.6 Some use ~/.profile or ~/.bashrc instead. Read more about the difference … -
django-mediasync 2.0: Havana Nights
It's been almost a year since the last release of mediasync, but the new features we've worked on are worth the wait! If you use mediasync, please indicate that you do so on our Django Packages profile. Source on GitHub: https://github.com/sunlightlabs/django-mediasync Package on PyPI: http://pypi.python.org/pypi/django-mediasync/ Install with pip or easy_install: pip install django-mediasync easy_install django-mediasync What is this media syncing you speak of? For those of you new to the project, mediasync is a Django app that manages static media in both development and production. Imagine a project where you have to make updates to existing media, but all references are hardcoded to some absolute path in production. Do you update the production media and risk breaking the site or do you temporarily point to local media and hope you don't forget to revert the change? With mediasync you don't need to worry about any of that. Paths to media are automatically generated: local in debug, remote in production, and manually overridden when needed. Modify your media in your local development environment then use mediasync to push the change to the remote production server. Reduce stress and add years to your life! A whirlwind tour of new features Pluggable backends … -
Why you should go to Pycon
Because you are new to PythonIf you want to get better at Python then Pycon is one of the better avenues to learn. Think of it as a nine day data dump of Pythonic knowledge straight to your brain!When it comes to the fundamentals of Python, the tutorials are a great way to hit the ground running. How do you think I learned? Also, there are dozens of beginner talks designed to introduce you what highly qualified people think you should be doing. Finally, the sprints are a great way to work with real experts for days - because even the most advanced projects needs people to knock out the invariable score of simple bugs, do documentation and write additional tests.Also, Zed Shaw is going to teach his Learning Python the Hard Way tutorial throughout the conference. (follow that link!) To summarize, besides going over his lessons and some basic conference coaching, he's going to take his class to conference talks and then bring them back to apply what was learned. He won't be doing it alone either - a number of other python folk are going to volunteer their time to help, and I'm going to be one of … -
Dutch Django meeting in Amsterdam, part one
Again a nice Dutch Django meeting in the American book center's do-it-yourself conference center in Amsterdam. Two bigger talks and a couple of lightning talks. Books I read and liked: recommendations - Wim Feijen Just some good books. Too many to list in a summary :-) Either "the big moo" or "purple cow" by Seth Godin. Just read one of 'em. No bullshit guide to management. Eckart's notes: real nice, read it when interesting about expanding but staying small. Four hour work week by Ferriss. Ignore lots of things. Become an expert. Don't answer the phone but design a system that deals with it. Best explanation available of the pareto principle available. Getting real. Inmates are running the asylum. New venture, starting up: about writing business plans. Code complete. Principles of beautiful web design. Wonderful for designers. Homepage usability by Nielsen. Integrating XHTML validation with unit tests - Erik Romijn Tag soup is normally inconsistently parsed. All sorts of problems if your html isn't valid. You are going to forget to validate and re-validate your pages once in a while. So integrate it in your unit tests! xhtml is proper xml and it has a DTD, so you can validate … -
Django south article
I normally don't do short posts with just a link, but this warrants an exception: http://www.djangopro.com/2011/01/django-database-migration-tool-south-explained/ I can't hope to explain South any better :-) We're starting to use South for more and more projects. It helps a lot when doing iterative development. You do need to take a little extra care, though, but south pays itself back many times over. -
Django south article
I normally don't do short posts with just a link, but this warrants an exception: http://www.djangopro.com/2011/01/django-database-migration-tool-south-explained/ I can't hope to explain South any better :-) We're starting to use South for more and more projects. It helps a lot when doing iterative development. You do need to take a little extra care, though, but south pays itself back many times over. -
django-socialregistration and 'closed' sites.
I develop a 'closed' system. It isn't that not just anyone can use it - hell, we'd love to have more customers, but the users of the front-facing site (myROSS) are not the same as our customers, who use the backend indirectly through our client application. The outcome of this is that we do not allow for registration on myROSS. The only way you can become a user of myROSS is if your company uses The ROSS System, and you have been added by your manager, franchisee or whatever. However, I have been looking at django-socialregistration a bit lately: it is a very clean way to allow users to register and then login using Facebook, Twitter OAuth, and OpenID. Since one of the reasons that many of our 'users' do not use myROSS as much as we would like is because it is another password to remember, and also because most of our users are younger employees of Quick Service Restaurants, we are hoping that allowing them to use their Facebook or Twitter credentials will mean the barrier to use of myROSS is reduced. So, I would like to be able to use socialregistration to allow currently registered users to … -
Celery uses spin-loops. Gah!
Here’s another cautionary performance tale. If you use Celery subtasks to manage parallel work, know going in that it uses spin-loops to monitor subtask progress. Specifically, if you get a TaskSetResult from a TaskSet and then use iterate() or join(), the underlying code will eat your CPU alive. Here’s the code in celery.result.TaskSetResult: The symptom [...] -
A performance lesson on Django QuerySets
At work, we’ve contracted with PostgreSQL Experts to help us improve our Postgres performance. After analyzing our system, one of their consultants, Christophe Pettus, found glaring problems in how some of my code accessed our database. I consider myself well-informed about good database access practices in Django, and in general. I might not exactly hit [...] -
Postgres site will migrate to Django
One interesting tidbit from last night’s PostgreSQL BOF session was the news that Postgres’ site would be migrated to Django within the next year. This came from Josh Berkus. Postgres’ site now is apparently generated from a bespoke PHP script mishmash. Josh said that tasks like creating new forms was much harder than they ought to [...] -
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] -
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 … -
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 … -
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
-
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... -
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.