FAQ

1. What’s the meaning of the Django “IndentationError” message in the browser?

(added 29 Jan ’12, regarding M1).

Python issues an IndentationError when it encounters indentation it can’t understand. Remember, indentation is significant for delimiting code blocks with definitions, conditional statements, and loops.

It’s likely that you have some code indented further than it should be. In Milestone 1, some of you left an extra space when you removed comments from two lines in urls.py:

# Uncomment the next two lines to enable the admin:
 from django.contrib import admin
 admin.autodiscover()

Those lines need to be completely flush left.

2. The setup-account script did not report my account name. What’s up?

(added 29 Jan ’12, regarding M1).

setup-account failure

setup-account failure

This is probably because your VM is not properly connected to the Internet — see the next question.

3. My VM cannot access the Internet. How to fix it?

(added 29 Jan ’12).

Try the following commands in the terminal:

$ sudo ifdown eth0
$ sudo ifup eth0

These will reset your VM’s network and give it a new IP address. If it doesn’t work, then go into the VM network adapter settings (there’s an icon in the lower right of the Virtual Box frame), change the setting NAT to Bridged (or vice versa), and try the above again.

4. I’m getting the following error when trying to git push:

(added 6 Feb ’12).

 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '/home/league/tmp/git-test'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. [...]

This means that there have been some changes to your repository on the server, and you have to merge them in. Just try git pull before retrying git push.

comments powered by Disqus

 

©2012 Christopher League · some rights reserved · CC by-sa