Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Django Basics What a View! Our First App

A change in INSTALLED_APPS?

Hey, I'm following along, and I did notice that django is on version 1.9. So when I noticed that INSTALLED_APPS for me was a list, and not a tuple like in the video, I just assumed that this is a recent change. Am I right? Chris Freeman ? Kenneth Love ?

Also, quick question: can trailing commas ever break ANYTHING in python, or is it ALWAYS better to use one rather than not in the language?

1 Answer

Yes, INSTALLED_APPS is a list in 1.9 and a tuple in 1.8.

As far as trailing commas go, you can leave them on when defining Python sequences like lists, tuples and dictionaries; in fact it is considered good practice to do so, because you can easily append new elements at the end of the sequence w/o needing to remember to add a comma after the last item.

Hey, Thanks Andrei Fecioru! Chris Freeman , one of these days I'm going to remember to read the documentation, I swear!

Erika Suzuki
Erika Suzuki
20,299 Points

It also became a list for TEMPLATE_DIRS, STATIC_DIRS, and such...