Browser wont display my site



I am just getting started with the training and it looks like have a issue with my coding already, I managed to install python an django ok with a page displayed as per the book (the it Works Page)

next i add the index.html, the and the entries but now when the page is displayed it show this error, I am sure i am not the first to get this but the search did not show any results

expected an indented block (, line 6)


Check the formatting of your code — that error means that something has the wrong indentation. :) Line 6 specifically.


Yeah that was my initial thought, was a cut and paste from the book


Unfortunately when InDesign outputs the book files, it loses formatting information so you got to go in and fix the formatting. :(


This a simple fix all i needed to do was to add a tab in front of the second line of code, can anyone comment as to the reason for the needed space at the beginning of the line?

still learning


Sure thing! It’s because that’s how Python determines the order of code. It’s like a headline and content:


We know the above is a headline because it’s bold. Python uses indentation:


So the indented block tells Python that it’s basically the content under the header.

If you haven’t done so already, I’d suggest going through some of Learn Python the Hard Way which’ll explain how to work with Python. :)