Skip to content

Commit

Permalink
cleaned up apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Jpadilla1 committed Jul 12, 2014
1 parent 60a3770 commit b0e7aa1
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 56 deletions.
4 changes: 2 additions & 2 deletions chatrooms/messages/admin.py
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)
14 changes: 0 additions & 14 deletions chatrooms/messages/models.py
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
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)
15 changes: 0 additions & 15 deletions chatrooms/rooms/models.py
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
14 changes: 7 additions & 7 deletions chatrooms/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ class Common(Configuration):
# Third Party
'debug_toolbar',
'django_extensions',
# 'rest_framework',
# 'rest_framework_swagger',
'rest_framework',
'rest_framework_swagger',

# Apps
'chatrooms.users',
'chatrooms.messages',
Expand Down Expand Up @@ -75,8 +75,8 @@ class Common(Configuration):
"enabled_methods": [
'get',
'post',
# 'put',
# 'patch',
'put',
'patch',
'delete'
],
"api_key": '',
Expand Down Expand Up @@ -121,7 +121,7 @@ class Common(Configuration):

SITE_ID = 1

AUTH_USER_MODEL = 'users.User'
# AUTH_USER_MODEL = 'users.User'


class Development(Common):
Expand All @@ -142,4 +142,4 @@ class Development(Common):


class Production(Common):
DEBUG_TOOLBAR_PATCH_SETTINGS = False
DEBUG_TOOLBAR_PATCH_SETTINGS = False
4 changes: 2 additions & 2 deletions chatrooms/users/admin.py
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)
16 changes: 10 additions & 6 deletions chatrooms/wsgi.py
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()
15 changes: 12 additions & 3 deletions manage.py
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)
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Django==1.6.5
Werkzeug==0.9.6
dj-database-url==0.3.0
dj-static==0.0.5
django-autoslug==1.7.2
Expand All @@ -10,7 +11,9 @@ django-rest-swagger==0.1.14
djangorestframework==2.3.14
gunicorn==19.0.0
psycopg2==2.5.3
pystache==0.5.4
requests==2.3.0
six==1.7.3
sqlparse==0.1.11
static==1.0.2
wsgiref==0.1.2
11 changes: 6 additions & 5 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!doctype html>{% load staticfiles %}
<!doctype html>
{% load staticfiles %}
<html lang="en">

<head>
Expand All @@ -11,11 +12,11 @@
</head>

<body>
{% block header %}
{% endblock header %}
<header>
{% block header %}{% endblock header %}
</header>

{% block content %}
{% endblock content %}
{% block content %}{% endblock content %}

</body>

Expand Down
9 changes: 9 additions & 0 deletions templates/index.html
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 %}

0 comments on commit b0e7aa1

Please sign in to comment.