Thanks, Giles for the prompt response. Below is the error message i keep getting.
[2018-08-12 11:59:17,671] ERROR in app: Exception on /login [POST]
2018-08-12 11:59:17,675: Traceback (most recent call last):
2018-08-12 11:59:17,675: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1982, in wsgi_app
2018-08-12 11:59:17,675: response = self.full_dispatch_request()
2018-08-12 11:59:17,675: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1614, in full_dispatch_request
2018-08-12 11:59:17,675: rv = self.handle_user_exception(e)
2018-08-12 11:59:17,675: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1517, in handle_user_exception
2018-08-12 11:59:17,676: reraise(exc_type, exc_value, tb)
2018-08-12 11:59:17,676: File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 33, in reraise
2018-08-12 11:59:17,676: raise value
2018-08-12 11:59:17,676: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1612, in full_dispatch_request
2018-08-12 11:59:17,676: rv = self.dispatch_request()
2018-08-12 11:59:17,676: File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1598, in dispatch_request
2018-08-12 11:59:17,676: return self.view_functions[rule.endpoint](**req.view_args)
2018-08-12 11:59:17,676: File "/home/yousafe/mysite/flask_app.py", line 75, in login
2018-08-12 11:59:17,676: completion = validate(username, password)
2018-08-12 11:59:17,676: File "/home/yousafe/mysite/flask_app.py", line 55, in validate
2018-08-12 11:59:17,676: body=my_msg)
2018-08-12 11:59:17,677: File "/usr/local/lib/python3.6/dist-packages/twilio/rest/resources/messages.py", line 122, in create
2018-08-12 11:59:17,677: return self.create_instance(kwargs)
2018-08-12 11:59:17,677: File "/usr/local/lib/python3.6/dist-packages/twilio/rest/resources/base.py", line 365, in create_instance
2018-08-12 11:59:17,677: data=transform_params(body))
2018-08-12 11:59:17,677: File "/usr/local/lib/python3.6/dist-packages/twilio/rest/resources/base.py", line 200, in request
2018-08-12 11:59:17,677: resp = make_twilio_request(method, uri, auth=self.auth, **kwargs)
2018-08-12 11:59:17,677: File "/usr/local/lib/python3.6/dist-packages/twilio/rest/resources/base.py", line 152, in make_twilio_request
2018-08-12 11:59:17,677: resp = make_request(method, uri, **kwargs)
2018-08-12 11:59:17,677: File "/usr/local/lib/python3.6/dist-packages/twilio/rest/resources/base.py", line 117, in make_request
2018-08-12 11:59:17,677: resp, content = http.request(url, method, headers=headers, body=data)
2018-08-12 11:59:17,678: File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1322, in request
2018-08-12 11:59:17,678: (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
2018-08-12 11:59:17,678: File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1072, in _request
2018-08-12 11:59:17,678: (response, content) = self._conn_request(conn, request_uri, method, body, headers)
2018-08-12 11:59:17,678: File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 995, in _conn_request
2018-08-12 11:59:17,678: conn.connect()
2018-08-12 11:59:17,678: File "/usr/lib/python3.6/http/client.py", line 1392, in connect
2018-08-12 11:59:17,678: super().connect()
2018-08-12 11:59:17,678: File "/usr/lib/python3.6/http/client.py", line 936, in connect
2018-08-12 11:59:17,679: (self.host,self.port), self.timeout, self.source_address)
2018-08-12 11:59:17,679: File "/usr/lib/python3.6/socket.py", line 722, in create_connection
2018-08-12 11:59:17,679: raise err
2018-08-12 11:59:17,679: File "/usr/lib/python3.6/socket.py", line 713, in create_connection
2018-08-12 11:59:17,679: sock.connect(sa)
2018-08-12 11:59:17,679: ConnectionRefusedError: [Errno 111] Connection refused