Answer the question
In order to leave comments, you need to log in
Django doesn't start signal. Or is that how it should be?
Good day.
I have two Django projects ( VetpharmCommerce and VetDirectory ) on different databases, but they share a common table Users
. Done like this:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'vet-directory',
'USER': 'vetpharm',
'PASSWORD': '',
'HOST': '127.0.0.1',
'PORT': '',
'TEST': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
'users': {
'ENGINE': "django.db.backends.postgresql_psycopg2",
'NAME': "vetpharm_commerce",
'USER': "vetpharm",
'PASSWORD': "",
'HOST': "127.0.0.1",
'PORT': "5432"
}
}
User
with a signal:def create_profile(sender, instance, created, **kwargs):
""" Creates profile for user """
CustomerProfile.objects.get_or_create(user=instance)
post_save.connect(create_profile, sender=compat.AUTH_USER_MODEL)
User
with VetpharmCommerce , then everything is OK, CustomerProfile
it is created, but if I User
register with VetDirectory , then the record User
is created, but CustomerProfile
not. CustomerProfile
created regardless of which site you registered on? Can I get by with one signal on VetpharmCommerce , or does VetDirectory also need the same signal? Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question