diff --git a/.gitignore b/.gitignore index c0144b7..1aafbea 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ env/ .ar/ ar/ archilance/settings/local.py +chat/settings/local.py media/* static/* diff --git a/assets/js/chat.js b/assets/js/chat.js index e541f8d..8e6dc18 100644 --- a/assets/js/chat.js +++ b/assets/js/chat.js @@ -28,7 +28,8 @@ window.confirm = function (message, callback, caption) { }; var SocketHandler = function () { - domain = domain.replace(':' + port, ''); + //TODO: получать порт с файла настроек + domain = domain.replace(':' + port, ':8888'); if (window.location.protocol == 'https:') { var ws = "wss://"; } else { diff --git a/chat/chat.py b/chat/chat.py index 12a5d93..a26039b 100644 --- a/chat/chat.py +++ b/chat/chat.py @@ -1,7 +1,7 @@ import html import momoko -from settings import settings, PORT, DATABASE_DSN +from chat.settings.dev import settings, PORT, DATABASE_DSN from tornado import gen, web, websocket, escape from tornado.httpserver import HTTPServer from tornado.ioloop import IOLoop diff --git a/chat/settings/base.py b/chat/settings/base.py new file mode 100644 index 0000000..8600671 --- /dev/null +++ b/chat/settings/base.py @@ -0,0 +1,16 @@ +import os + +PORT = 8888 + +settings = { + 'cookie_secret': '__TODO:_GENERATE_YOUR_OWN_RANDOM_VALUE_HERE__', + 'template_path': os.path.join(os.path.dirname(__file__), 'templates'), + 'static_path': os.path.join(os.path.dirname(__file__), 'static'), + 'login_url': '/login', + 'xsrf_cookies': True, + 'debug': True, + 'autoreload': True, + 'server_traceback': True, +} + +DATABASE_DSN = 'dbname=archilance user=postgres password=postgres host=localhost' diff --git a/chat/settings/dev.py b/chat/settings/dev.py new file mode 100644 index 0000000..b095fbd --- /dev/null +++ b/chat/settings/dev.py @@ -0,0 +1,6 @@ +from .base import * + +try: + from .local import * +except ImportError: + pass