Hi all,
I have two different databases as below:
DATABASES = {
'tvet': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
},
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'jpk',
'USER': 'jpkuser',
'PASSWORD': 'jpkpassword',
'HOST': 'localhost', # Or an IP Address that your DB is hosted on
'PORT': '3306',
}
}
When I want to create a CreateView, I am unable to save it.
This is my CreateView:
class BiodataCreateView(CreateView):
template_name = 'bio_create.html'
# model = Biodata.objects.using('tvet').all()
def get_queryset(self):
return Biodata.objects.using('tvet').all()
fields = 'name', 'hobby'
def get_success_url(self):
return reverse('biodata-list')
Any idea on how to do it?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/4985efd7-437c-432e-86c8-9a902430513fn%40googlegroups.com.