Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inter user communication #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

harshitmittal99
Copy link
Collaborator

No description provided.

Copy link
Owner

@priyanshsaxena priyanshsaxena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comments:

  • Prettify your HTML, Python and JS files. Follow the alignment and variable-naming conventions - people must find your code readable.
  • PEP8 standard is used for Python files - you can use autopep8 tool to detect and fix most of your errors.
  • README can be removed, or its content added to the existing README file (not necessary).

@@ -0,0 +1,5 @@
#inter-user communication
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file might not be needed.

@@ -0,0 +1,9 @@
<html>
<body>
<form action = "http://localhost:5000/login" method = "get">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have a relative path instead of a fixed one.

@@ -0,0 +1,27 @@
from flask import Flask,render_template,redirect,request,url_for
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a white-space after every comma.

@app.route('/chat/<user>')
def chat(user):
return render_template('chat.html',user=user)
app.config['SECRET_KEY'] = 'secret!'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All secret-keys can be kept in a file, and that file should not be committed.

socketio = SocketIO(app)
@socketio.on('message')
def handle_message(message):
print(message)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use the logging module from Python instead of print methods.

<body>
<form action = "http://localhost:5000/login" method = "get">
<p>Enter Name:</p>
<p><input type = "text" name = "nm" /></p>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can nm be changed to name ?

$("#messages").append('<li>'+msg+'</li>');
console.log('Received message');
});
$('#sendbutton').on('click', function() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use sendButton instead of sendbutton. Notice the camel-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants