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 ORM Basic ORM Usage Restricting Results

Max Pinomaa
Max Pinomaa
2,647 Points

Tabs are only two spaces in my workspace

Hey y'all,

I'm wondering why my workspace is making tabs with two spaces. My understanding is that that can break python code. Can I change this in some settings? Or should I just do everything on my computer? I'm curious, why is this happening?

Workspace snapshot: https://w.trhou.se/2fpyt1aic3

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

In the lower right corner of the workspaces window there is an option to select how many spaces per incident. In your workspace it is set to two. Changing it to four will solve the problem.

Post back if you need more help. Good luck!!!

Max Pinomaa
Max Pinomaa
2,647 Points

Thanks for your answer. The tab size changed to 4 but I think the the files are still in 2 spaces tabs. Now I'm getting this:

    return render(request, 'courses/course_list.html', {'courses': courses})                                   
                                                                           ^                                   
IndentationError: unindent does not match any outer indentation level  

I tried starting a new workspace, and this is the one I'm using now: https://w.trhou.se/dso4qqdu3b

Chris Freeman
Chris Freeman
Treehouse Moderator 68,423 Points

The workspace control Spaces value control the insertion of space when you hit a TAB or newline. It isn't changing the interpretation of existing TAB to display, there are no TABs. Unfortunately, existing code needs to be manually reindented to the new specified spaces length.