$ python3 --version
Python 3.10.13
The command might be python --version
, depending on your local setup.
Take the version number that your local Python outputs and set it as an environment variable on the “Environments” tab of your service, as per the docs:
Key: PYTHON_VERSION
Value: 3.10.13
(matching the one your local machine shows).
Thank you for the patience. Now it’s almost 100% hahaha. Now the website opens with a 404 error and the following message appears in the render
==> Detected service running on port 10000
==> Docs on specifying a port: Web Services | Render Docs
127.0.0.1 - - [12/Jan/2024:15:18:31 +0000] “GET / HTTP/1.1” 404 207 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36”
127.0.0.1 - - [12/Jan/2024:15:18:32 +0000] “GET /favicon.ico HTTP/1.1” 404 207 “https://testvalidate.onrender.com/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36”
I put the default root route. The root route opened, but the endpoint is not opening, which would be ‘/validar_cpf’
==> Running ‘gunicorn validcpf:app’
Jan 12 02:10:03 PM[2024-01-12 17:10:03 +0000] [40] [INFO] Starting gunicorn 19.7.1
Jan 12 02:10:03 PM[2024-01-12 17:10:03 +0000] [40] [INFO] Listening at: http://0.0.0.0:10000 (40)
Jan 12 02:10:03 PM[2024-01-12 17:10:03 +0000] [40] [INFO] Using worker: sync
Jan 12 02:10:03 PM/opt/render/project/python/Python-3.10.13/lib/python3.10/os.py:1030: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
Jan 12 02:10:03 PM return io.open(fd, mode, buffering, encoding, *args, **kwargs)
Jan 12 02:10:03 PM[2024-01-12 17:10:03 +0000] [41] [INFO] Booting worker with pid: 41
Jan 12 02:10:12 PM127.0.0.1 - - [12/Jan/2024:17:10:12 +0000] “GET /validar_cpf HTTP/1.1” 200 48 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36”
https://testvalidate.onrender.com/validar_cpf returns a response from your code. If there’s an issue with that response, it will be a code issue that you’ll need to debug.
Hello, I’m here again, but now it’s another problem.
I did the right process and my api is now appearing to the uses, but when the uses are writing it always gives an error validation.
I’ll leave the logs here for you to take a look and check if there are any error logs, if there isn’t something in my code anyway.
==> Uploading build…
Jan 19 03:43:42 PM==> Build uploaded in 8s
Jan 19 03:43:42 PM==> Build successful
Jan 19 03:43:49 PM==> Deploying…
Jan 19 03:44:11 PM==> Using Node version 20.10.0 (default)
Jan 19 03:44:11 PM==> Docs on specifying a Node version: Setting Your Node.js Version | Render Docs
Jan 19 03:44:15 PMcp: cannot overwrite directory ‘/opt/render/project/src/.venv’ with non-directory
Jan 19 03:44:15 PM==> Running ‘gunicorn validcpf:app’
Jan 19 03:44:18 PM[2024-01-19 18:44:18 +0000] [42] [INFO] Starting gunicorn 19.7.1
Jan 19 03:44:18 PM[2024-01-19 18:44:18 +0000] [42] [INFO] Listening at: http://0.0.0.0:10000 (42)
Jan 19 03:44:18 PM[2024-01-19 18:44:18 +0000] [42] [INFO] Using worker: sync
Jan 19 03:44:18 PM/opt/render/project/python/Python-3.10.13/lib/python3.10/os.py:1030: RuntimeWarning: line buffering (buffering=1) isn’t supported in binary mode, the default buffer size will be used
Jan 19 03:44:18 PM return io.open(fd, mode, buffering, encoding, *args, **kwargs)
Jan 19 03:44:18 PM[2024-01-19 18:44:18 +0000] [43] [INFO] Booting worker with pid: 43
Jan 19 03:44:20 PMYour service is live
It looks like you might have created a .venv
secret file which is creating the “cannot overwrite” error message in the logs you shared. But that doesn’t seem to be stopping the deploy. Try removing it to stop that message.
If you’re having an error while running your application, the error wouldn’t be in the deploy logs. If may be appearing in the service logs, the “Logs” tab of your service.