Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ from nltk.corpus import stopwords
|
|
| 7 |
import nltk
|
| 8 |
|
| 9 |
# Download NLTK data (only required once)
|
| 10 |
-
nltk_data_dir =
|
| 11 |
os.makedirs(nltk_data_dir, exist_ok=True)
|
| 12 |
nltk.data.path.append(nltk_data_dir)
|
| 13 |
|
|
@@ -16,7 +16,7 @@ nltk.download('stopwords', download_dir=nltk_data_dir)
|
|
| 16 |
|
| 17 |
app = Flask(__name__)
|
| 18 |
app.secret_key = 'your_secret_key_here' # Required for session management
|
| 19 |
-
socketio = SocketIO(app)
|
| 20 |
|
| 21 |
# Path to the text file where messages will be stored
|
| 22 |
MESSAGE_FILE = 'chat_messages.txt'
|
|
@@ -174,4 +174,4 @@ def remove_matched_messages(buyer, seller, product):
|
|
| 174 |
f.writelines(new_messages)
|
| 175 |
|
| 176 |
if __name__ == '__main__':
|
| 177 |
-
socketio.run(app, debug=True, host='0.0.0.0')
|
|
|
|
| 7 |
import nltk
|
| 8 |
|
| 9 |
# Download NLTK data (only required once)
|
| 10 |
+
nltk_data_dir = "/tmp/nltk_data"
|
| 11 |
os.makedirs(nltk_data_dir, exist_ok=True)
|
| 12 |
nltk.data.path.append(nltk_data_dir)
|
| 13 |
|
|
|
|
| 16 |
|
| 17 |
app = Flask(__name__)
|
| 18 |
app.secret_key = 'your_secret_key_here' # Required for session management
|
| 19 |
+
socketio = SocketIO(app,cors_allowed_origins="*")
|
| 20 |
|
| 21 |
# Path to the text file where messages will be stored
|
| 22 |
MESSAGE_FILE = 'chat_messages.txt'
|
|
|
|
| 174 |
f.writelines(new_messages)
|
| 175 |
|
| 176 |
if __name__ == '__main__':
|
| 177 |
+
socketio.run(app, debug=True, host='0.0.0.0',port=5000)
|