You can use one of the utils in that library

from tenant_schemas.utils import schema_context
from django.contrib.auth.models import User

with schema_context('yourschemaname'):
     ...

Or you can manually run the management command form the shell

python manage.py createsuperuser



2016-06-16 7:06 GMT+01:00 Sayantan Ganguly <sayantangangs...@gmail.com>:

> I am using Django-Tenant-Schemas for my multi tenant app.
>
> Now, I have come to face a huge problem.
>
> I need to use @login-required for views. But how to have an admin (the
> creator & owner of the schema) to only create/register user. If a "register
> yourself" page is available to all, then anyone can register.
>
> If I can have an admin for each tenant, then I can easily use
> @required-permission decorator for the "register" view.
>
> Hence, my question is how to create admin/super user for each tenant.
>
>
> I cannot create the admin from the "create database"/"register your firm"
> (which is getting dynamically created from the register page, linked to the
> landing page) view as it is in the public schema.
>
> --
> 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 django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/962cf79a-f1ad-4709-8f07-5888429450a1%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/962cf79a-f1ad-4709-8f07-5888429450a1%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotsoft.es/blog/

-- 
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2BxOsGDbr4Cd0T7asVpxTnYXc-FKR_0Yt1wBpdUCmRd0gSpMVw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to