# coding: utf8 import sys from utils import rel sys.path.append(rel('apps/')) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Kosolapov Dmitry', '*****@*****.**'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': 'db.sql', # Or path to database file if using sqlite3. # The following settings are not used with sqlite3: 'USER': '', 'PASSWORD': '', 'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP. 'PORT': '', # Set to empty string for default. } } DATABASE_OPTIONS = {
# -*- coding: utf-8 -*- from utils import rel TEMPLATE_PATH = rel('templates')
tornado.options.define("address", default="localhost", help="Run on host", type=str) tornado.options.parse_command_line() # Create multiplexer channels = { "username_choice": connections.UsernameChoiceConnection, "stats": connections.StatsConnection, "note": connections.NoteConnection, "games_list": connections.GamesListConnection, "games_join": connections.GamesJoinConnection, "game_create": connections.GameCreateConnection, "game_action": connections.GameActionConnection, "game_finish": connections.GameFinishConnection, } router = MultiplexConnection.get(**channels) # Register multiplexer MainSocketRouter = SockJSRouter(router, "/socket") # Create application app = tornado.web.Application( [(r"/", IndexHandler), (r"/static/(.*)", tornado.web.StaticFileHandler, {"path": rel("static")})] + MainSocketRouter.urls ) app.listen(tornado.options.options.port, address=tornado.options.options.address) io_loop = tornado.ioloop.IOLoop.instance() tornado.autoreload.start(io_loop) io_loop.start()
SITE_ID = 1 # If you set this to False, Django will make some optimizations so as not # to load the internationalization machinery. USE_I18N = True # If you set this to False, Django will not format dates, numbers and # calendars according to the current locale. USE_L10N = True # If you set this to False, Django will not use timezone-aware datetimes. USE_TZ = True # Absolute filesystem path to the directory that will hold user-uploaded files. # Example: "/home/media/media.lawrence.com/media/" MEDIA_ROOT = rel('public/media/') # URL that handles the media served from MEDIA_ROOT. Make sure to use a # trailing slash. # Examples: "http://media.lawrence.com/media/", "http://example.com/media/" MEDIA_URL = '/media/' # Absolute path to the directory static files should be collected to. # Don't put anything in this directory yourself; store your static files # in apps' "static/" subdirectories and in STATICFILES_DIRS. # Example: "/home/media/media.lawrence.com/static/" STATIC_ROOT = rel('public/static/') # URL prefix for static files. # Example: "http://media.lawrence.com/static/" STATIC_URL = '/static/'
'note': connections.NoteConnection, 'games_list': connections.GamesListConnection, 'games_join': connections.GamesJoinConnection, 'game_create': connections.GameCreateConnection, 'game_action': connections.GameActionConnection, 'game_finish': connections.GameFinishConnection } router = MultiplexConnection.get(**channels) # Register multiplexer MainSocketRouter = SockJSRouter(router, '/socket') # Create application app = tornado.web.Application([ (r'/', IndexHandler), ( r'/static/(.*)', tornado.web.StaticFileHandler, { 'path': rel('static') }, ), ] + MainSocketRouter.urls) app.listen(tornado.options.options.port, address=tornado.options.options.address) io_loop = tornado.ioloop.IOLoop.instance() tornado.autoreload.start(io_loop) io_loop.start()