bug fix + refactor long_poll.js
configured django authentication.
refactored templates to make them slightly cleaner.