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

Multiple Admin sites with different registered models #148

Open
narzeja opened this issue Jul 31, 2014 · 0 comments
Open

Multiple Admin sites with different registered models #148

narzeja opened this issue Jul 31, 2014 · 0 comments

Comments

@narzeja
Copy link

narzeja commented Jul 31, 2014

I wish to built a site that enables two or more Admin sites, such that one contains one set of models and the other contains a different (or overlapping) set of models.
However, the navigation menu and links on the sites are screwed up, and doesn't behave as I would expect: when navigating the models on adminsite1, I get shown the navigation menu from adminsite2, and the title of both sites is the branding of adminsite2.

I wish to do something like this (models omitted):

from app import app, db
from models import SomeModel1, SomeModel2, Users
from flask_peewee.auth import Auth
from flask_peewee.admin import Admin
auth = Auth(app, db, user_model=Users)

adminsite1 = Admin(app, auth, prefix='/admin1', name='admin1', branding='Admin1')
adminsite2 = Admin(app, auth, prefix='/admin2', name='admin2', branding='Admin2')

auth.register_admin(adminsite1)
auth.register_admin(adminsite2)
adminsite1.register(SomeModel1)
adminsite2.register(SomeModel2)

auth.setup()
adminsite1.setup()
adminsite2.setup()

What am I missing, or is this possible at all out-of-the-box?

Alternatively, I am looking for a way to control that only some users get access to all tables/models, while other users do not.

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

1 participant