add setup.py
make compatible with django 1.5:
  - replace function-based generic views
  - imports
  - update templates
Merge branch 'compatibility-1.5'
Merge branch 'add-setup-py'
declared encoding for setup.py
some environments (like mine) will actually try to do some other redirects before we get to the external_link view. We need to follow all redirects so that we are more likely to actually trigger the view we want to test
in this test, we actually cause a system error exception because we try to write something that's not an IP to the database
validate the remote_addr and zero it out if it's invalid.

I had a bad remoteaddr happen on my server, I think it came from xforwardedfor header where the first value in there was "unknown". It happens...
dont mangle blocks of text that just happen to start with http:/ ... add a test case for this. Fix is a bit of a hack, but the alternative is to not use re.split() because it cannot distinguish between a match and a non-match.