Skip to content

Commit

Permalink
setup for deployment and demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Jpadilla1 committed Jul 23, 2014
1 parent b4e31f2 commit 318ee8d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
19 changes: 11 additions & 8 deletions chatrooms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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': (
Expand Down Expand Up @@ -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/'

Expand All @@ -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
Expand Down Expand Up @@ -182,3 +184,4 @@ class Development(Common):

class Production(Common):
DEBUG_TOOLBAR_PATCH_SETTINGS = False
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
4 changes: 2 additions & 2 deletions chatrooms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
)
3 changes: 2 additions & 1 deletion chatrooms/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()


Expand Down

0 comments on commit 318ee8d

Please sign in to comment.