10👍
✅
DATABASE_NAME is deprecated since django 1.2 so if you’re using newer version, you should use the new way of defining databases:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'mydatabase'
}
}
4👍
define db name is settings.py
DATABASE
Below is an example
DATABASES = {
'default': {
'ENGINE': 'mysql',
'NAME': 'xyz', # db name
'USER': 'root',
'PASSWORD': 'password',
'HOST': '',
'PORT': '',
}
}
👤sush
- [Django]-How to make DRF serializer compatible with uppercase
- [Django]-Should I use JWT or Sessions for my eCommerce website?
- [Django]-Django crispy-forms dynamic label_class and field_class
- [Django]-Rest Framework Tutorial IntegrityError creating snippets
- [Django]-In django, is it possible to have a foreign key defined to some superclass, but having returned the subclass when queried?
Source:stackexchange.com