Posted on July 12, 2008 at 10:09 P.M.

It's always been a goal of mine to post screencasts here on my blog, but for whatever reason I never ended up getting around to it. Today, that all changes as I have created two new screencasts. Of course, this space is already very well-covered by both Michael Trier and Brian Rosner, so hopefully this adds something new to the conversation.

Setting up a Django Development Environment

In this screencast I show how I typically set up my Django development environment. It goes through installing Django by checking out the latest development version and linking it to the correct places on your system. It also talks about how to install reusable applications. Finally, it covers how to update all of those projects and keep a toolbox of snippets for your personal use.

The simple pylink command that I use in the screencast is this:

#!/bin/bash
ln -s `pwd`/$1 `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`/$1

Please let me know in the comments if you have any other tips and tricks for setting up a development environment for Django.

Using Django-Pagination

Django-pagination is an application that I wrote and released a while ago, which I use all the time, but that hasn't really seen much attention. In this screencast, I show how to take an existing project with too much data on one page, and use django-pagination to quickly and easily paginate the items on the page. There is a bit more documentation for the project that's available in the project directory if you do a subversion checkout, and docstrings throughout the source code, if you're interested in how it works.

Keep in Mind

These are my very first screencasts, ever. I'm not entirely sure what I'm doing yet, and the only way I can improve is by your feedback. If you have any advice and/or criticisms of these screencasts, please don't keep your mouth shut--speak up, and let me know in the comments. Hopefully someone finds these useful, and thanks for watching!

at 2:03 p.m.
on July 13, 2008

Wow, excellent work! These are great. You have a real engaging and pleasant sounding vocal delivery. Keep them up.

huxley
at 2:42 p.m.
on July 13, 2008

The pagination one was great, gonna go back and check out the first one just because the second one was so good.

at 2:44 p.m.
on July 13, 2008

Wow, thanks for the kind words Empty and huxley!

huxley
at 3:50 p.m.
on July 14, 2008

You deserve the praise, those are darned fine screencasts.

BTW, for those who don't know, Empty is Michael Trier of "This Week in Django" podcast fame (and responsible for some great Django screencasts), so praise from him is a sure sign you're doing great stuff.

Andreas
at 2:52 p.m.
on July 13, 2008

Awesome. Really great sound and overall quality as empty already stated.

John M
at 2:57 p.m.
on July 13, 2008

Outstanding!!

This reminds me of how I used to setup my laptop to do Foxpro development (long before webcasts).

This gives me a great starting point, and confirms some of the ideas I've already implemented for django development.

Keep up the excellent work Eric!

John

nuggien
at 3:10 p.m.
on July 13, 2008

Great work. I hope you add more screencasts on other django topics.

at 3:15 p.m.
on July 13, 2008

That's the plan :) Thanks!

at 3:34 p.m.
on July 13, 2008

The second screencast is great! I'll try django-pagination tomorrow and I hope it is as easy as in your screencast.

Maybe this is the wrong place for asking this, but is it possible to change the URLs from /foo/?page=42 to /foo/page/42/?

at 3:40 p.m.
on July 13, 2008

Thanks! Right now it's not possible to change away from the GET parameters, but I'd love to support an arbitrary URL scheme. Please open a ticket and let's see if we can figure it out.

BTW, the ticket tracker is here: http://code.google.com/p/django-pagination/issues/list

Chris Hasenpflug
at 4:54 p.m.
on July 13, 2008

Very nicely done, Eric. Looking forward to more in the future!

One question I do have is the use of your toolbox module and keeping it in sync with your production server. It seems you must replicate the toolbox module there as well? For this reason, I tend to put things like that in the actual project folder.

at 6:25 p.m.
on July 13, 2008

I actually have a private repository that I use to sync my toolbox. But really it works well both ways. I tend to keep it globally accessible because it forces me to abstract my patterns for reuse rather than do one-off fixes for each project.

at 10 p.m.
on July 13, 2008

Anything in your toolbox we should include with Pinax?

at 11:08 p.m.
on July 13, 2008

Not really. Most of it is fairly specific to my projects. Otherwise, it's stuff from djangosnippets that we have replacements for or use already in Pinax.

Onno
at 5:06 p.m.
on July 13, 2008

superb, show more

at 6:21 p.m.
on July 13, 2008

eric, you did a great job. i know these things aren't easy and take a lot of time. you did great. keep up the excellent work!

Tony
at 1:17 a.m.
on July 14, 2008

Eric,
That was a great screencast - clean, easy to hear, and it's certainly shown the django-pagination application in a very good light!

You're in my RSS feeds now and I'll be looking forward to the next one!

Cheers,
Tone

at 2:12 a.m.
on July 14, 2008

Very nicely done. You have an engaging and relaxing voice and your topic was well-defined. I thought it was professional indeed.

at 3:09 a.m.
on July 14, 2008

The pagination screencast is excellent, good length and good pace. I'll be giving pagination a look today because you made it look so easy ! Keep up the great work.

at 3:18 a.m.
on July 14, 2008

Great Screencasts!
Keep up the good work :)

at 5:59 p.m.
on July 14, 2008

I must add that the pagination screencast was timely as i was looking at doing exactly this.

thanks

P.S: any chance at requesting screenshots? i would like to see on on django-comments-utils

at 9:25 p.m.
on July 14, 2008

It might be a good idea to check out http://stephendeken.net/wiki/software/keycastr/ to show what key strokes you take when it is a bit more implicit.

By the way excellent job!

at 12:14 a.m.
on July 16, 2008

Thanks, that's an awesome tip! I'll probably use it for the next one.

at 10:25 p.m.
on July 14, 2008

It's amazing, thx for all dude..

Very simple to use.. perfect .. just a number and vouala!

thx !

Al
at 1:16 a.m.
on July 15, 2008

Eric,

You said at the end of the video that pagination isn't fetching everything as it's lazy-loading. If you're not fetching the entire list, are you querying a second time to get the total count of rows, so you know how many pages are required in the paging?

Al.

at 12:12 a.m.
on July 16, 2008

Yes, it's not just one round-trip to the database. Behind the scenes, it uses Django's "Paginator" object, so if you want to delve into the exact performance tradeoffs, check that out.

at 9:18 a.m.
on July 15, 2008

I second that your voice is really good. The problem with a toolbox is the portability of your apps because it depends on your environment, if you want to release an app with an XFNField, you need to remember to copy it before.

I didn't know the pylink script, thanks! I often use manage.py to add the cwd to sys.path, it works fine too, at least for tests.

A small tip for the first screencast, you can use "cd" and it will go to your home folder even if you do not mention the "~".

Keep up :)

at 12:11 a.m.
on July 16, 2008

Thanks for the compliment!

About the toolbox: You're absolutely right. Like anything else, it's definitely a tradeoff.

Also, it's good to know about plain "cd". I didn't know that was possible!

Liam
at 4:03 p.m.
on July 15, 2008

Very handy. Great presentation.

dude
at 4:07 p.m.
on July 15, 2008

Good one!

at 9:37 a.m.
on July 16, 2008

Great screencasts! Did you decide on what specific topic the next one is going to be?

vds
at 11:42 a.m.
on July 16, 2008

Thanks for your work, I wonder why not use a zc.buildout to create a development environment?

at 1:39 p.m.
on July 17, 2008

That was so cool.
Now i have new vision about how to setup the development enviroment. Before this video i was always doing the svn up && sudo python setup.py install but that pylink stuff is really cool. Thx. so much. now i m a subcriber of you :)

at 6:31 p.m.
on July 17, 2008

and maybe for newbies at linux you can explain howto add the ~/bin directory to the users path. liike adding
the export PATH=$PATH:~/bin
row to the
~/.bashrc
file. thx. again. And on linux. it doesn't allow you to make a symlink to the python path. using the command with sudo works fine.

Thx. again
Regards...

at 10:23 p.m.
on July 17, 2008

Good point, I really forgot that ~/bin was nonstandard! I should have pointed that out :(

nasim
at 6:34 p.m.
on July 17, 2008

Great screencast! Waiting for more!

Is it possible to make a podcast stream in iTunes?

at 10:26 p.m.
on July 17, 2008

Yep! The URLs to know are these:

iTunes: itpc://djangoscreencasts.blip.tv/rss/itunes/
RSS: http://djangoscreencasts.blip.tv/rss
Miro: http://subscribe.getmiro.com/?url1=http://djangoscreencasts.blip.tv/rss

Ak
at 8:14 p.m.
on July 18, 2008

I am new to the Mac/Mac's terminal and was wondering how you got your pylink script to save in the GNU nano section then go back to the regular terminal?

Gil
at 11:04 a.m.
on July 19, 2008

Awesome screencasts !

Another nice addon to your development environment would be using bash CDPATH.

Create a nice shortcut to each of your apps by:

# export CDPATH='~ericflo/development/pyhton'

at 8:59 p.m.
on July 19, 2008

These are great. Any plans on making one for setting up a development environment?

at 9:55 a.m.
on July 22, 2008

Great screencasts! They remind me a lot of railscasts, which is a good thing. I've subscribed to your podcast. Please keep them coming! They are a joy to watch.

Oscar
at 4:08 a.m.
on July 30, 2008

Awesome!

at 9:25 a.m.
on July 31, 2008

Very cool!

Just wondering: I noticed you put your templates and apps under the 'twitterclone' project. Is that how you normally do things? How do you decide when an app belongs within a project or in the development directory? Where do you place your projects? Within the development directory or separately?

Thanks, looking forward to seeing and hearing more :)
-Björn

at 4:34 a.m.
on Aug. 5, 2008

Just watched the first screencast and was by FAR the best Django screencast I've seen so far. Explained everything clearly, didn't move on or clear the screen too quickly.

As someone who's never programmed before and learning from the ground up this was an invaluable first step. Look forward to seeing more from you in the future :)

Search

 

Recent Links

  • Callcast - Discussion with Jeff Croft
  • Great discussion with Jeff Croft and Kevin Fricovsky, talking about Django, design, web standards, and various other things. Kevin has really been on fire lately in his blog, and Jeff has some good stuff to say. Both their sites are bookmarks, for sure.

  • git-issues: A distributed issue tracker built-in to Git.
  • I predicted this back in March--can't believe a solution has surfaced so soon. It makes so much sense to build in an issue tracker to a revision control system. Since you're working with the code, might as well track the issues in the same system and take advantage of the extra metadata. This is really cool (and as a bonus, it's written in Python) so I hope to see it really grow and flourish!

  • How I Work Daily
  • Daily blog by Kevin Fricovsky. In addition to having some really great content, he has started to post audio interviews with people from the Django community. This is a site to keep an eye on in the coming days and months.

  • django-arcade
  • Demo site for django-arcade, an open source reusable Django app to add new flash games to any django-powered site. Looks very cool for easily creating game portals. It also comes from my future employer.

  • Facebook Chat and Scalability (with Erlang)
  • Eugene Letuchy talks about how they they took Facebook Chat from no users to 70 million users, with the help of Erlang.

  • Simon Willison: The Implications of OpenID
  • I somehow missed this presentation when it came out, but it's an absolutely fantastic overview and defense of OpenID by Simon Willison. If you are in any way interested in what OpenID is and what it can offer, you owe it to yourself to check out this presentation.

  • See the rest of my links...

Pownce

Badges

  • django badge
  • apache badge
  • GeoURL
  • XFN Friendly
  • Valid HTML 4.01 Transitional