Category : server

I followed this tutorial describing how to use alternate domain names with Flask (anything other than localhost). However, I’m getting a "Name or service not known" error when attempting to use flask.dev. app.py: from flask import Flask app = Flask(__name__) # Set the domain name app.config[‘SERVER_NAME’] = ‘flask.dev:5000’ if __name__ == "__main__": app.run(debug=True) Modified the ..

Read more

I’m trying to write a simple "server" that inherits from BaseHTTPRequestHandler and is able to receive GET and POST requests. I have a server.py file that, so far, looks like this: from http.server import BaseHTTPRequestHandler, HTTPServer from cgi import parse_header, parse_multipart from urllib.parse import parse_qs host = "localhost" port = 8080 hello_msg = "Server running…" ..

Read more

There is a Java program "DTacl.jar" which: reads ‘PATH: X:………’ from settings.acl file looks for specific files in given location sets permissions on those files And python script "Czekacz.py" which: using watchdog observer observes a location ‘X:…’ having noticed a change writes a ‘PATH: X:pathOfChange’ to settings.acl works nonstop And other python script "wykonanie.py" which: ..

Read more

I’m relatively new to websocket and asyncio and is struggling to gracefully handle the scenario when my server looses a connection. My server code is: #!/usr/bin/env python # https://websockets.readthedocs.io/en/stable/intro.html import asyncio import websockets import socket USERS = set() def users_event(): return str(len(USERS)) async def notify_users(): if USERS: # asyncio.wait doesn’t accept an empty list message ..

Read more

I’m studying Flask, I have a server on register.it that I use for my experiments. I created a phyton file with the classical Hello world! (the original code was more complicated but I’ve tried to reduce it to find the error), and a frontend page that requests the string using jquery POST. Everything seems to ..

Read more