Closed Wanhenri closed 4 years ago
other error:
C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask_sqlalchemy\__init__.py:800: UserWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True to suppress this warning.
warnings.warn('SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True to suppress this warning.')
* Debugger is active!
* Debugger PIN: 276-203-085
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
##################
wanderson
123123123
teste
##################
ESTA?
127.0.0.1 - - [10/Jun/2020 21:37:38] "←[35m←[1mPOST /vendor_item HTTP/1.1←[0m" 500 -
Traceback (most recent call last):
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask_restful\__init__.py", line 272, in error_router
return original_handler(e)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask_restful\__init__.py", line 272, in error_router
return original_handler(e)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\_compat.py", line 38, in reraise
raise value.with_traceback(tb)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask\app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask_restful\__init__.py", line 472, in wrapper
return self.make_response(data, code, headers=headers)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask_restful\__init__.py", line 501, in make_response
resp = self.representations[mediatype](data, *args, **kwargs)
File "C:\Users\Wanderson\.virtualenvs\api-OxVh_rFM\lib\site-packages\flask_restful\representations\json.py", line 21, in output_json
dumped = dumps(data, **settings) + "\n"
File "c:\users\wanderson\appdata\local\programs\python\python37\lib\json\__init__.py", line 238, in dumps
**kw).encode(obj)
File "c:\users\wanderson\appdata\local\programs\python\python37\lib\json\encoder.py", line 201, in encode
chunks = list(chunks)
File "c:\users\wanderson\appdata\local\programs\python\python37\lib\json\encoder.py", line 438, in _iterencode
o = _default(o)
File "c:\users\wanderson\appdata\local\programs\python\python37\lib\json\encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type Vendor is not JSON serializable
Fixed error add_vendor_database
The class had the same name as the function. note: correct in the other function in /add_product_database.py
This bug was corrected in: /add_product_database.py
An error occurred while connecting the database function to the flask.
ERROR