Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does Admin work with tenant-schemas? #44

Closed
end0 opened this issue May 11, 2013 · 4 comments
Closed

How does Admin work with tenant-schemas? #44

end0 opened this issue May 11, 2013 · 4 comments

Comments

@end0
Copy link

end0 commented May 11, 2013

Hi - Great package! It's really clean and easy to use so far. As I'm playing with it, I'm having some trouble getting the Admin stuff to work. I'm trying to setup Admin on the main tenant, but having some trouble with tenant-schemas attaching /main/ to the url. Also, the main admin be able to view data in the other schemas, or am I supposed to setup a superuser for each new tenant?

@guillempuey
Copy link

Hi,

I'm trying to setup a multi-tenant-schema database with one admin for each tenant. Is it possible? When I add a tenant model object into the public schema using the admin, i get the following error:

insert or update on table "django_admin_log" violates foreign key constraint "django_admin_log_user_id_fkey"
DETAIL: Key (user_id)=(1) is not present in table "auth_user".

I supose that it reffers to the TENANT_APPS django.contrib.auth...

These are my settings:

SHARED_APPS = (
'tenant_schemas', # mandatory
'MyApp.common', # you must list the app where your tenant model resides in

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',

)

TENANT_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'tastypie',
)

If it is not the right place to get support, please, let me know who can help me.

Thanks in advance!

Guillem

@bernardopires
Copy link
Owner

@Barnalite. This is a weird error considering you have admin and auth
installed both in SHARED and in TENANT. How are you syncing the models? Can
you paste your INSTALLED_APPS here too?

2013/6/7 Barnalite notifications@github.com

Hi,

I'm trying to setup a multi-tenant-schema database with one admin for each
tenant. Is it possible? When I add a tenant model object into the public
schema using the admin, i get the following error:

insert or update on table "django_admin_log" violates foreign key
constraint "django_admin_log_user_id_fkey"
DETAIL: Key (user_id)=(1) is not present in table "auth_user".

I supose that it reffers to the TENANT_APPS django.contrib.auth...

These are my settings:

SHARED_APPS = (
'tenant_schemas', # mandatory
'MyApp.common', # you must list the app where your tenant model resides in

'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',

)

TENANT_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'tastypie',
)

If it is not the right place to get support, please, let me know who can
help me.

Thanks in advance!

Guillem


Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-19102232
.

Bernardo Pires Carneiro

@guillempuey
Copy link

@bcarneiro Hi. I'm so new in Django stuff and I'd like to get a litle more information on how to use the django-tenant-schemas. Cause I think that I'm missing something... which is the best way to that? writing my questions here? or is it possible to send a private message anyhow?

Thanks!

@bernardopires
Copy link
Owner

Read the documentation and create a new issue explaining what you don't
understand or what problem you are having. I'm not going to reply to
private messages as the same question you have could also help someone else
in the future

2013/6/9 Barnalite notifications@github.com

@bcarneiro https://github.com/bcarneiro Hi. I'm so new in Django stuff
and I'd like to get a litle more information on how to use the
django-tenant-schemas. Cause I think that I'm missing something... which is
the best way to that? writing my questions here? or is it possible to send
a private message anyhow?

Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//issues/44#issuecomment-19167321
.

Bernardo Pires Carneiro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants