In this article, I will write about the errors that occurred in Django + Docker application development and how to deal with them.
ERROR: No container found for web_1 I tried various things, but I couldn't figure out how to deal with it, but I solved it by typing in the terminal as follows.
terminal
$ docker-compose up -d
Reference article ERROR: No container found for web_1 #11045
TypeError: Field 'id' expected a number but got datetime.datetime(2020, 9, 16, 2, 52, 51, 44897, tzinfo=
I added the following to the location of the Foreign key in models.py.
models.py
user = models.OneToOneField(
User,
verbose_name='user',
on_delete=models.CASCADE,
default=1 #Postscript
)
This solved it.
django.db.utils.OperationalError: could not translate host name "db" to address: Name or service not known
I was using sqlite3, but I get this error frequently, so I introduced Postgresql.
See here for the procedure.
ERROR: yaml.scanner.ScannerError: while scanning for the next token For this error, check the indentation of "docker-compose.yml". Please note that even if you comment out, you will get angry if the indentation is off.
yaml.parser.ParserError: while parsing a block mapping Please check the indent of "docker-compose.yml" even with this error.
Recommended Posts