Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added chat/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added chat/__pycache__/admin.cpython-311.pyc
Binary file not shown.
Binary file added chat/__pycache__/apps.cpython-311.pyc
Binary file not shown.
Binary file added chat/__pycache__/models.cpython-311.pyc
Binary file not shown.
Binary file added chat/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file added chat/__pycache__/views.cpython-311.pyc
Binary file not shown.
Binary file not shown.
Binary file added chat/migrations/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file modified db.sqlite3
Binary file not shown.
Binary file added djangochat/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file added djangochat/__pycache__/settings.cpython-311.pyc
Binary file not shown.
Binary file added djangochat/__pycache__/urls.cpython-311.pyc
Binary file not shown.
Binary file added djangochat/__pycache__/wsgi.cpython-311.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion djangochat/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []
ALLOWED_HOSTS = ['djangodemocat.pythonanywhere.com', 'localhost', '127.0.0.1']


# Application definition
Expand Down
19 changes: 13 additions & 6 deletions templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@
<body>

<div align="center">
<h2>Django Chat</h2>
<h2>Xiong's Family</h2>
</div>


<div class="container">
<style>
input[type=text], select {
Expand Down Expand Up @@ -96,10 +95,18 @@ <h2>Django Chat</h2>

<form id="post-form" method="POST" action="checkview">
{% csrf_token %}
<label>Room Name</label>
<input type="text" name="room_name" id="room_name" width="100px" />
<label>Username</label>
<input type="text" name="username" id="username" width="100px" />
<label>Topic Selection</label>
<select name="room_name" id="room_name">
<option value="Miles Muxi Xiong">Miles Muxi Xiong</option>
<option value="Zhu_Health_Check">Zhu_Health_Check</option>
<option value="Xiong_Health_Check">Xiong_Health_Check</option>
<option value="4_Parents_Health">4_Parents_Health</option>
</select>
<label>Select Your Name</label>
<select name="username" id="username">
<option value="Liwen">Liwen</option>
<option value="Zebo">Zebo</option>
</select>
<input type="submit" value="Enter Room">
</form>
</div>
Expand Down
16 changes: 5 additions & 11 deletions templates/room.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,18 @@
}

.time-left {
float: left;
color: #999;
}

</style>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
</head>
<body>

<h2>{{room}} - DjChat</h2>
<h2>Topic: {{room}}</h2>

<div id="display">

<!-- <div class="container darker">
<b>Tom</b><p>Hello Everyone, How Are You Guys Doing?</p>
<span class="time-left">20th, April 2021</span>
</div> -->

</div>

<script>
Expand All @@ -79,7 +74,7 @@ <h2>{{room}} - DjChat</h2>
$("#display").empty();
for (var key in response.messages)
{
var temp="<div class='container darker'><b>"+response.messages[key].user+"</b><p>"+response.messages[key].value+"</p><span class='time-left'>"+response.messages[key].date+"</span></div>";
var temp="<div class='container darker'><b>"+response.messages[key].user+"</b><b>: </b><p style='display: inline'>"+response.messages[key].value+"</p></b><b>&nbsp &nbsp</b><span style='color: #999'>"+response.messages[key].date+"</span></div>";
$("#display").append(temp);
}
},
Expand All @@ -91,13 +86,12 @@ <h2>{{room}} - DjChat</h2>
})
</script>


<div class="container">
<style>
input[type=text], select {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
padding: 0px 0px;
margin: 0px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
Expand Down