Forums

Can not upload local Sqlite3 database to PythonAnywhere

Hello!

I made simple application using Flask, but can not upload to it my local Sqlite3 database with size 46MB. I tried to upload different sized databases with 5MB, but I also see message errors when uploading.

Error I see in the end of uploading - 500 Internal Server Error.

hmm- can you try again? it turns out that one of our servers had filled up all the space allocated for logging- I cleared it down and it should all work fine now!

Very sorry for the inconvenience- let us know if it still doesn't work.

I uploaded file successfully! But now I can not delete some files which I uploaded for testing :( For example I have file named dataFormatting.py, and when I press delete icon I see the file contents (code) while the url seems to be correct https://www.pythonanywhere.com/user/chinga/files/home/chinga/mysite/dataFormatting.py?action=delete_file.

Thanks for your help!

hmm. If the file you are using is also being used by your webapp, you may not be able to delete it because the code is still being run on the webapp server (or if you are using it somewhere and it hasn't finished executing yet). Maybe that's the case?

Hello? Please i have a local sqlite3 database which i uploaded to work with my web app, but anytime i call on it, i get this error message "Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application." Please what should i do?

When you get an error like that, the details will be put into your website's error log -- there's a link on the "Web" page. Take a look; the most recent error will be at the bottom, and it should help you work out what's going wrong. If you can't work out what the issue is, post the error message here and we should be able to help.

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

[edited by admin: formatting]

That sounds like you are using the twilio package and it is erroring.

See this for using twilio as a free user on PythonAnywhere.

Hi Conrad? I made the edits but i keep getting that same error. Help

Did you reload your webapp?

yes i did and i am still getting that same error.

Where are you setting the proxy stuff up? If it's at the module level (that is, outside any functions), it might be worth trying moving it into the view function where you're creating the twilio client object and seeing if that helps.