diff --git a/chatrooms/settings.py b/chatrooms/settings.py index 1b0e67b..6e1680b 100644 --- a/chatrooms/settings.py +++ b/chatrooms/settings.py @@ -14,7 +14,7 @@ class Common(Configuration): TEMPLATE_DEBUG = values.BooleanValue(DEBUG) - ALLOWED_HOSTS = [] + ALLOWED_HOSTS = ['*', ] SESSION_ENGINE = 'redis_sessions.session' SESSION_REDIS_PREFIX = 'session' @@ -62,9 +62,9 @@ class Common(Configuration): 'DEFAULT_MODEL_SERIALIZER_CLASS': 'rest_framework.serializers.HyperlinkedModelSerializer', - 'DEFAULT_PERMISSION_CLASSES': ( - 'rest_framework.permissions.AllowAny', - ), + # 'DEFAULT_PERMISSION_CLASSES': ( + # 'rest_framework.permissions.AllowAny', + # ), 'PAGINATE_BY': 25, 'DEFAULT_RENDERER_CLASSES': ( @@ -116,7 +116,8 @@ class Common(Configuration): # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.6/howto/static-files/ - # STATIC_ROOT = 'static' + + STATIC_ROOT = 'staticfiles' STATIC_URL = '/static/' @@ -133,13 +134,14 @@ class Common(Configuration): WSGI_APPLICATION = 'ws4redis.django_runserver.application' WEBSOCKET_URL = '/ws/' - # WS4REDIS_ALLOWED_CHANNELS = ['subscribe-room', 'subscribe-demo', ] WS4REDIS_EXPIRE = 7200 WS4REDIS_HEARTBEAT = '--heartbeat--' + WS4REDIS_HOST = values.Value(environ_prefix=None, default='localhost') + WS4REDIS_PORT = values.Value(environ_prefix=None, default=6379) WS4REDIS_CONNECTION = { - 'host': 'localhost', - 'port': 6379, + 'host': WS4REDIS_HOST, + 'port': WS4REDIS_PORT, } # CORS settings @@ -182,3 +184,4 @@ class Development(Common): class Production(Common): DEBUG_TOOLBAR_PATCH_SETTINGS = False + SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') diff --git a/chatrooms/urls.py b/chatrooms/urls.py index 6799612..2f0f550 100644 --- a/chatrooms/urls.py +++ b/chatrooms/urls.py @@ -8,9 +8,9 @@ urlpatterns = patterns( '', url(r'^admin/', include(admin.site.urls)), - url(r'^', DemoChatView.as_view(), name='index'), url(r'^docs/', include('rest_framework_swagger.urls')), url(r'^api-v1/', include('chatrooms.router')), url(r'^api-auth/', - include('rest_framework.urls', namespace='rest_framework')) + include('rest_framework.urls', namespace='rest_framework')), + url(r'^', DemoChatView.as_view(), name='index'), ) diff --git a/chatrooms/wsgi.py b/chatrooms/wsgi.py index 0490415..660f7a6 100644 --- a/chatrooms/wsgi.py +++ b/chatrooms/wsgi.py @@ -10,6 +10,7 @@ import os import sys +from dj_static import Cling from django.conf import settings from ws4redis.uwsgi_runserver import uWSGIWebsocketServer from configurations.wsgi import get_wsgi_application @@ -22,7 +23,7 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chatrooms.settings') os.environ.setdefault('DJANGO_CONFIGURATION', ENVIRONMENT) -_django_app = get_wsgi_application() +_django_app = Cling(get_wsgi_application()) _websocket_app = uWSGIWebsocketServer()