Erro
...
File "/usr/local/lib/python3.6/site-packages/MySQLdb/__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/MySQLdb/connections.py", line 164, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (1130, "Host '172.23.0.4' is not allowed to connect to this MySQL server")
ERROR: 1
Docker compose
version: '3'
services:
db:
image: mysql:5.7
ports:
- '3306:3306'
environment:
MYSQL_DATABASE: 'todo_dev'
MYSQL_USER: 'devops_dev'
MYSQL_PASSWORD: 'mestre'
MYSQL_ROOT_PASSWORD: 'senha'
web:
image: aluracursos/django_todolist_image_build
volumes:
- ./env:/usr/src/app/to_do/.env
ports:
- "8000:8000"
depends_on:
- db
arquivo env
[config]
# Secret configuration
SECRET_KEY = 'r*5ltfzw-61ksdm41fuul8+hxs$86yo9%k1%k=(!@=-wv4qtyv'
# conf
DEBUG=True
# Database
DB_NAME = "todo_dev"
DB_USER = "devops_dev"
DB_PASSWORD = "mestre"
DB_HOST = "db"
DB_PORT = "3306"