DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': env('NAME'),
'USER': env('DB_USER'),
'PASSWORD': env('PASSWORD'),
'HOST': env('HOST'),
'PORT': env('PORT'),
'OPTIONS': {
'init_command': 'SET sql_mode="STRICT_TRANS_TABLES"'
}
}
}
DEBUG=on
NAME={name}
DB_USER={user}
PASSWORD={password}
HOST={host}
PORT=3306
class User(models.Model):
user_id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False, null=False)
email = models.EmailField(max_length=200, null=False,default=False)
password = models.CharField(max_length=255, null=False, default=False)
created_at = models.DateTimeField(auto_now_add=True, blank=True)
deleted_at = models.DateTimeField(auto_now=True, blank=True)
is_deleted = models.BooleanField(default=False)
class Meta:
db_table = 'user'
python3 manage.py makemigrations
: Migration 생성
python manage.py migrate
: Migration 적용