DjangoCon 2009 review
Tue, 15 Sep 09, 00:17:17
filed in
Django
This was my first DjangoCon and the first conference I've been to where I felt I didn't know a large number of people. I'd always gone to conferences with more than one person, or where I knew a large amount of people. It wasn't quite "social skydiving" as my friend likes to call it, because as it turns out I knew lots of people there.
Tuesday was the first day of the conference and the first talk. I was surprised by Fake Jacob who gave a very witty first talk that had us all laughing - a good way to start the conference. The conference was a big room, enough for 200, with tables running across the hall. Everyone had a laptop and pretty much they were a Mac. In some ways I prefer not having a table to make people look at the speaker.
Some of the highlights were:
- "Almost a Vancouverite" Avi Bryant's talk, which was interesting on a few fronts. The last 5-6 sites I've built have all had just a REST and JSON interface, but for me the catalyst of this was jQuery, JSONP and Google App Engine which allowed you build and mashup sites really quickly. I covered this at Open Web Vancouver.
- Simon Willison's talk about the Guardian work was excellent. Based on stuff I knew already, there were still some interesting snippets in there.
- Going out for an excellent fondue with a whole bunch of new friends and then meeting up later with others for some fine Portland Ale. If I listed everyone, I would offend the people I left out. One person it was cool to see later was Michel Pelletier.
- I missed Ian Bicking's keynote, I'll blame it on the beer, but had a good chance to chat to him afterwards.
- That night a whole bunch of us got together to talk about the Django Software Foundation and that was cool. It's something I'm very keen to help out on and definitely an area I can contribute on. Not much was decided but lots of ideas and enthusiasm.
- Wednesday had some great highlights with Ted Leung's talk which was interesting as ever.
- I really liked the Custom Signals For Uncoupled Design talk. I'm a big fan of signals and the idea of just sticking them all of the place, such as pre and post form creation, seem like great ideas. And Justin Bronn's talk was great - short and informative. Both talks I can bookmark and know I'll come back to one day.
All in all it was a great conference and met a whole bunch of cool people there, I'll know next DjangoCon I can walk in and it will feel like meeting a bunch of old friends.
I did two talks (both in this blog) and they went pretty well, the malnutrition one seemed to particularly well received. For those in the audience on the debugging one I'm sorry - last time I used those font colours and combinations it worked really well. The projectors were quite overwhelmed by the lights and I couldn't see the slides on the project due to the setup. Wish someone had said, something. I spent a while making them clearer for the next one.
It did seem at this conference that quite a few things went wrong, with speakers not turning up and confusion about the talks. But Robert Lofthouse was around, helpful and responsive and that's great. Looking forward to the next one.
Fighting Malnutrition with SMS and Django
Thu, 10 Sep 09, 15:46:11
filed in
Django
These are the slides of the Fighting Malnutrition with SMS and Django, it covers my work with the RapidSMS project in Kenya and Malawi and focuses on some of the technical bits.
RapidSMS is in need of Django programmers willing to volunteer - especially people who can speak Spanish and French. If you are keen to help out, you could find this a very rewarding projects to work on.
What the heck went wrong?
Tue, 08 Sep 09, 16:32:00
filed in
Django
These are my slides from the talk at DjangoCon 2009. It was only 15 minutes long so had to go pretty quickly and skips over some details, but hopefully it's useful.
Update: met Rob Hudson after (of django-debug-toolbar fame) and he said that django-debug-logging does pretty much what my django-sql-profile does, so go check that out.
First things to do on a Django project...
Thu, 03 Sep 09, 23:47:32
filed in
Django
Call them best practices if you like, but here's the things I do when starting a new Django project.
- Create an "app" app. The app folder is the catch all for all the non-reusable parts of your site. The bit that actually does alot of the site specific stuff. Usually, but not always, it only contains an emptymodels.py (this is so that Django knows its an app).
- Create a templates folder. Inside the app project, this is for all the site specific stuff, as opposed to hopefully reusable parts in the specific folders.
- Create a template context processor. You know you will need one eventually, every project does. Don't forget to hook it into the settings file. Mine is normally called context.py and placed in the app project. It does absolutely nothing at this point, it's just waiting to be customised.
- Create a middleware file. You might not need it, but chances are you will. Don't forget to hook it into the settings file. Mine is normally called middleware.py and placed in the app project. Again it does absolutely nothing at this point.
- (Optional) Create a custom authentication backend. Called authentication.py and placed in the app project. Hook it up when you need it.
So that's the app project. Next let's set up the static content, that's easy:
- Create a "static" folder. This is where the css, js, img will live.
- Serve static through the dev server. When it goes live, I leave the content and urls in the same place, but have static overriden at the Apache (or your favourite server) level to serve the static content and not your dev server.
Create a restart script that starts everything cleanly. For me this normally means:
- drops the database
- recreates it
- syncs the database (syncdb), without input
- creates a superuser, or loads in a fixture with that data
- loads in the required fixtures
Here's an old one that does that, I've changed the one I use a bit since then, will need to do a new post. Whilst you are quickly iterating this is the best way to go, it keeps it clean and simple. You'll want to use South or django-evolution once it goes live of course.
For each subsequent app (things that have the models that actually do the work) that you create:
- Create a forms folder add an __init__.py inside it. Forms will live here.
- Delete models.py and create a models folder. Add an __init__.py inside it. In the __init__.py import each of the modules that you will be adding. Don't forget to add in app_label on your models.
- Inside the models folder, create a fixtures folder. Guess what goes in here.
- Create a signals.py. Signal code will go here.
- Delete views.py and create a views folder.
- Create a tests folder, add an __init__.py inside it. Tests will live here.
- Create a template folder. This is where the templates live.
And that's about it. Next to do on the list is to create a paster script that does all this so you don't have to.
|
About
Andy McKay works at Clearwind Consulting and can emailed at andy@clearwind.ca. If you are web developer, you need to try Arecibo.
Blogs
Months
-
All
-
February, 10
-
January, 10
-
December, 09
-
November, 09
-
October, 09
-
September, 09
-
August, 09
-
July, 09
-
June, 09
-
May, 09
-
April, 09
-
March, 09
-
February, 09
-
January, 09
-
December, 08
-
November, 08
-
October, 08
-
September, 08
-
August, 08
-
July, 08
-
June, 08
-
May, 08
-
April, 08
-
March, 08
-
February, 08
-
January, 08
-
December, 07
-
November, 07
-
October, 07
-
September, 07
-
August, 07
-
July, 07
-
June, 07
-
May, 07
-
April, 07
-
March, 07
-
February, 07
-
January, 07
-
December, 06
-
November, 06
-
October, 06
-
September, 06
-
August, 06
-
July, 06
-
June, 06
-
May, 06
Categories
|