I have two databases:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'data_base_1',
'USER': 'root',
'PASSWORD': 'password',
'HOST': '',
'PORT': '',
},
'another_database': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'data_base_2',
'USER': 'root',
'PASSWORD': 'password',
'HOST': '',
'PORT': '',
},
}
How should I create ModelForms for ‘default’ models and for ‘another_database’ models?
Thanks.
What do you mean by creating ModelForms FOR one or another?
You can create ModelForms as usual and use
in order to save the data in a specific DB, if this was actually your question:)
See Selecting a database for save()