""" Run the CHAT server """ from chat import app, socketio if __name__ == '__main__': # app.run(host='0.0.0.0', debug=True) socketio.run(app, policy_server=False, transports='websocket, xhr-polling, xhr-multipart')
def run(): socketio.run(app)
from chat import app, socketio if __name__ == '__main__': socketio.run(app, policy_server=False, transports='websocket, xhr-polling, xhr-multipart')
#!/usr/bin/python3 from chat import app, socketio #from flask import Flask #from flask_socketio import SocketIO if __name__ == "__main__": # app.run(debug=True) socketio.run(app, debug=True)
data.data.replace('\r', '').split("\n")] else: all_data[data.name] = data.data image_groups = [] all_data['images'] = [] for image in Image.query.filter(Image.filename.like('port_%')).all(): groups = image.filename.split("_") image_dict = {'url': url_for('get_img', filename=image.filename), 'group': groups[1], 'name': groups[2].split('.')[0]} if groups[1] not in image_groups: image_groups.append(groups[1]) all_data['images'].append(image_dict) all_data['image_groups'] = image_groups return render_template("portfolio.html", data=all_data) @app.route("/eid/<url>") def lebaran(url): if url == "tal": return render_template("lebaran.html") # eid_data = EidData.query.filter_by(url=url) # name = eid_data.name # return render_template() if __name__ == "__main__": socketio.run(app, host='0.0.0.0', port=5000)
from chat import createApp, socketio from flask import Flask import uuid if __name__ == "__main__": app = Flask(__name__) app = createApp(app) app.config["SECRET_KEY"] = uuid.uuid4().hex app.debug = True socketio.run(app)
#!/bin/env python from chat import create_app, socketio app = create_app(debug=True) if __name__ == '__main__': socketio.run(app, host='0.0.0.0', port=2001)