I'm currently working with TornadoWeb but appear to have picked up a lot of bad habbits. I'd appreciate some feedback on the code below:

import tornado.ioloop

#modules
import auth
import base
import tag

#pymongo
import pymongo
connection = pymongo.Connection("127.0.0.1", 27017)
db = connection.prod
def get(self):

class Account(base.Base):
def get(self):
self.render('account.html', None)

class Sites(base.Base):
def get(self):
self.render('sites.html', None)

def get(self):

## MAIN TABS
# home
(r"/version/3/home", Account),
(r"/version/3/tags", tag.Tags),
(r"/version/3/tagPost", tag.tagPost),
(r"/version/3/tagRemove", tag.tagRemove),
# JAVASCRIPT
(r"/version/3/customer.js", CustomerJS),

if __name__ == "__main__":
application.listen(9099)


import tornado.ioloop

#modules


This comment doesn't say much, its fairly clear that anything starting with import is a module. It would be better to say something about why these three modules are grouped - eg, 'http/html modules'. But for a low number of imports, you mightn't bother with the comment at all.

import auth
import base
import tag

#pymongo


Same again; this comment doesn't say anything that the code doesn't. This one you can just drop.

import pymongo


Put a blank line below your last import. Also, where are auth, tag and base from? They sound like your own support modules rather than part of a third-party package, in which case the imports should go after pymongo, rather than before, per PEP 8.

connection = pymongo.Connection("127.0.0.1", 27017)
db = connection.prod
def get(self):


Stick to either single or double quotes throughout your code, rather than swapping between them.

        self.set_header("Content-Type", "Application/x-javascript")

class Account(base.Base):


If base is your own module, you should pick a better name for it.

    def get(self):
self.render('account.html', None)

class Sites(base.Base):
def get(self):
self.render('sites.html', None)

def get(self):


These three classes differ only by one hard-coded string argument. I'm assuming these are going to be expanded a bit later, but even so - consider consolidating them.

application = tornado.web.Application([
## MAIN TABS
# home


Drop this comment, its clear that its the home page from the next line.

        (r"/version/3/home", Account),


Is there a reason why all of these strings are raw strings?

        # ads


Does this comment really apply to the entire next block of code (including the bits dealing with Tags and tagPost, etc)? If it doesn't, the comment is not only redundant but actually misleading.

        (r"/version/3/ads", Ads),
(r"/version/3/tags", tag.Tags),
(r"/version/3/tagPost", tag.tagPost),
(r"/version/3/tagRemove", tag.tagRemove),


Why do you suddenly indent further from here?

        # JAVASCRIPT


Put a blank line before this.

        (r"/version/3/customer.js", CustomerJS),


You've passed a long list as the first argument to Application, and then a single string value as a second - but the way you've set it out, it could be mistaken as sending many arguments to Application. Better to do it this way:

Application(
[ # Main tabs
(r"/version/3/home", Account),
...
# Javascript
(r"/version/3/customer.js", CustomerJS),
],

if __name__ == "__main__":