Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set django database settings

Tags:

django

I am new to django. I need to use mysql database. I also need to specify the host, username, password..etc I tried to change my .settings file but it is not working

DATABASES = {
'default': {
    'ENGINE': 'mysql',
    'NAME': 'database',                      
    'USER': 'root',
    'PASSWORD': 'passwd',
    'HOST': 'localhost',                      
    'PORT': '',
}
}
like image 932
user2162428 Avatar asked Apr 18 '26 20:04

user2162428


1 Answers

Its django.db.backends.mysql not just mysql

DATABASES = {
    'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': 'database',                      
    'USER': 'root',
    'PASSWORD': 'passwd',
    'HOST': 'localhost',                      
    'PORT': '',
    }
}
like image 63
leet Avatar answered Apr 21 '26 16:04

leet