Closed aayush-kumar-codes closed 3 years ago
Is anything else printed back on the console to indicate an error ?
No, I have fixed this error by adding app name in init.py app = Sanic(name="brave")
But still when i am running app and opening url i am getting 500 internal server error.
@moschopsuk
Hmm I'm unable to replicate can yous share more details of your setup please ?
ERROR:sanic.root:Exception occurred while handling uri: 'http://localhost:5000/' Traceback (most recent call last): File "/Users/mark/sourcecode/brave/venv/lib/python3.7/site-packages/sanic/app.py", line 892, in handle_request request, request_name=name File "/Users/mark/sourcecode/brave/venv/lib/python3.7/site-packages/sanic/app.py", line 1220, in _run_request_middleware response = await response File "/Users/mark/sourcecode/brave/brave/api/init.py", line 42, in give_session_to_each_route_handler request['session'] = session TypeError: 'Request' object does not support item assignment
pip install sanic==19.3.1
@moschopsuk issue still not resolved....... I am still getting error on http://0.0.0.0:5000/
etech@etech-Aspire-ES1-572:~/Desktop/brave$ pipenv run ./brave.py
/home/etech/Desktop/brave/brave/inputs/input.py:37: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if position is not None and position is not -1:
/home/etech/Desktop/brave/brave/inputoutputoverlay.py:137: SyntaxWarning: "is not" with a literal. Did you mean "!="?
if a is not 'state' and hasattr(self, a):
/home/etech/Desktop/brave/brave/connections/connection_to_mixer.py:287: SyntaxWarning: "is" with a literal. Did you mean "=="?
if audio_or_video is 'video':
[2021-03-15 18:00:21 +0530] [55804] [INFO] Goin' Fast @ http://0.0.0.0:5000
INFO:sanic.root:Goin' Fast @ http://0.0.0.0:5000
[2021-03-15 18:00:29 +0530] [55804] [ERROR] Exception occurred while handling uri: 'http://0.0.0.0:5000/'
Traceback (most recent call last):
File "/home/etech/.local/share/virtualenvs/brave-Ja8gTjmL/lib/python3.8/site-packages/sanic/app.py", line 891, in handle_request
response = await self._run_request_middleware(
File "/home/etech/.local/share/virtualenvs/brave-Ja8gTjmL/lib/python3.8/site-packages/sanic/app.py", line 1220, in _run_request_middleware
response = await response
File "/home/etech/Desktop/brave/brave/api/__init__.py", line 42, in give_session_to_each_route_handler
request['session'] = session
TypeError: 'Request' object does not support item assignment
ERROR:sanic.root:Exception occurred while handling uri: 'http://0.0.0.0:5000/'
Traceback (most recent call last):
File "/home/etech/.local/share/virtualenvs/brave-Ja8gTjmL/lib/python3.8/site-packages/sanic/app.py", line 891, in handle_request
response = await self._run_request_middleware(
File "/home/etech/.local/share/virtualenvs/brave-Ja8gTjmL/lib/python3.8/site-packages/sanic/app.py", line 1220, in _run_request_middleware
response = await response
File "/home/etech/Desktop/brave/brave/api/__init__.py", line 42, in give_session_to_each_route_handler
request['session'] = session
TypeError: 'Request' object does not support item assignment
![Uploading Screenshot from 2021-03-15 18-01-56.png…]()
Cannot start Rest API: Sanic instance cannot be unnamed. Please use Sanic(name='your_application_name') instead. checking solution for this
I have fixed the error by adding sanic app name but after that app is running but getting insternal server error on url.