Skip to content

Commit

Permalink
created room model and installed django-websocket-redis
Browse files Browse the repository at this point in the history
  • Loading branch information
Jpadilla1 committed Jul 12, 2014
1 parent c8db7b4 commit 3d64b83
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chatrooms/rooms/admin.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django.contrib import admin

# from .models import Room
from .models import Room


# admin.site.register(Room)
admin.site.register(Room)
13 changes: 13 additions & 0 deletions chatrooms/rooms/models.py
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
from django.db import models

from ..users.models import User


class Room(models.Model):
title = models.CharField(max_length=20)
created_by = models.ForeignKey(User)
created_at = models.DateTimeField(auto_now_add=False)
members = models.ManyToManyField(User)
is_private = models.BooleanField(default=False)

def __str__(self):
return self.title
3 changes: 3 additions & 0 deletions chatrooms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Common(Configuration):
'django.contrib.staticfiles',

# Third Party
'ws4redis',
'debug_toolbar',
'django_extensions',
'rest_framework',
Expand Down Expand Up @@ -120,6 +121,8 @@ class Common(Configuration):

AUTH_USER_MODEL = 'users.User'

WEBSOCKET_URL = '/ws/'


class Development(Common):
DEBUG = True
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ django-dotenv==1.2
django-extensions==1.3.8
django-filter==0.7
django-rest-swagger==0.1.14
django-websocket-redis==0.4.1
djangorestframework==2.3.14
gevent==1.0.1
greenlet==0.4.2
gunicorn==19.0.0
psycopg2==2.5.3
pystache==0.5.4
redis==2.10.1
requests==2.3.0
six==1.7.3
sqlparse==0.1.11
Expand Down

0 comments on commit 3d64b83

Please sign in to comment.