Commit cd0cc98c authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

Added credentials to a vars.py

- Added a variable file (for credentials)  vars.py thats referenced by run.py and tasks.py
- added vars file to be used by run.py and tasks.py
- fixed type Key to key
- added username and password as variables
- removed print statemt
- removed credentials from file
- removed trailing whitespace
parent e9e8a0f3
...@@ -4,6 +4,7 @@ import os ...@@ -4,6 +4,7 @@ import os
import time import time
import signal import signal
import tasks import tasks
import vars
from flask import session from flask import session
from flask_socketio import SocketIO, join_room from flask_socketio import SocketIO, join_room
...@@ -15,8 +16,8 @@ monkey.patch_all(subprocess=True) ...@@ -15,8 +16,8 @@ monkey.patch_all(subprocess=True)
config_name = os.getenv('FLASK_CONFIG') config_name = os.getenv('FLASK_CONFIG')
app = create_app(config_name) app = create_app(config_name)
app.config['SECRET_KEY'] = 'vnkdjnfjknfl1232#' app.config['SECRET_KEY'] = vars.key
socketio = SocketIO(app, message_queue='amqp://reggie:reggie@ohpc:5672/socketio') socketio = SocketIO(app, message_queue= vars.message_queue)
@socketio.on('connect') @socketio.on('connect')
def socket_connect(): def socket_connect():
......
...@@ -2,14 +2,15 @@ from celery import Celery ...@@ -2,14 +2,15 @@ from celery import Celery
import time import time
from flask_socketio import SocketIO from flask_socketio import SocketIO
import subprocess import subprocess
import vars
from gevent import monkey from gevent import monkey
monkey.patch_all(subprocess=True) monkey.patch_all(subprocess=True)
broker_url = 'amqp://reggie:reggie@ohpc:5672/' broker_url = vars.broker_url
celery = Celery('flask_user_reg', broker=broker_url) celery = Celery('flask_user_reg', broker=broker_url)
socketio = SocketIO(message_queue='amqp://reggie:reggie@ohpc:5672/socketio') socketio = SocketIO(message_queue=vars.message_queue)
def send_msg(event, room): def send_msg(event, room):
print("Post '{}' to room '{}'".format(event,room)) print("Post '{}' to room '{}'".format(event,room))
......
id = ''
password = ''
key = ''
broker_url = 'amqp://' + id + ':' + password + '@ohpc:5672/'
message_queue = broker_url + 'socketio'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment