-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
53 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from django.contrib import admin | ||
|
||
from .models import Message | ||
# from .models import Message | ||
|
||
|
||
admin.site.register(Message) | ||
# admin.site.register(Message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1 @@ | ||
from django.db import models | ||
|
||
from ..users.models import User | ||
from ..chats.models import ChatRoom | ||
|
||
|
||
class Message(models.Model): | ||
created_by = models.ForeignKey(User) | ||
room = models.ForeignKey(ChatRoom) | ||
created_at = models.DateTimeField(auto_now=False) | ||
body = models.CharField(max_length=400, | ||
help_text='Max characters is 400.') | ||
|
||
def __unicode__(self): | ||
return self.body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1 @@ | ||
from django.db import models | ||
|
||
from autoslug import AutoSlugField | ||
|
||
from ..users.models import User | ||
|
||
|
||
class Room(models.Model): | ||
name = models.CharField(max_length=30, unique=True) | ||
created_by = models.ForeignKey(User) | ||
members = models.ManyToManyField(User, related_name="room_members") | ||
slug = AutoSlugField(populate_from='name') | ||
key = models.CharField(max_length=15,) | ||
|
||
def __unicode__(self): | ||
return self.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from django.contrib import admin | ||
|
||
from .models import User | ||
# from .models import User | ||
|
||
|
||
admin.site.register(User) | ||
# admin.site.register(User) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
""" | ||
WSGI config for chatrooms project. | ||
WSGI config for notaso project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ | ||
https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chatrooms.settings") | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
from dj_static import Cling | ||
|
||
application = Cling(get_wsgi_application()) | ||
ENVIRONMENT = os.getenv('ENVIRONMENT', 'DEVELOPMENT').title() | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chatrooms.settings') | ||
os.environ.setdefault('DJANGO_CONFIGURATION', ENVIRONMENT) | ||
|
||
from configurations.wsgi import get_wsgi_application | ||
|
||
application = get_wsgi_application() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
#!/usr/bin/env python | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
|
||
import dotenv | ||
|
||
dotenv.read_dotenv() | ||
|
||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chatrooms.settings") | ||
ENVIRONMENT = os.getenv('ENVIRONMENT', 'DEVELOPMENT').title() | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chatrooms.settings') | ||
os.environ.setdefault('DJANGO_CONFIGURATION', ENVIRONMENT) | ||
|
||
from django.core.management import execute_from_command_line | ||
from configurations.management import execute_from_command_line | ||
|
||
execute_from_command_line(sys.argv) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block title %} | ||
Chatrooms API | ||
{% endblock title %} | ||
|
||
{% block header %} | ||
|
||
{% endblock header %} |