-
Notifications
You must be signed in to change notification settings - Fork 178
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 to .create_table() and insert user for peewee-admin to be useful? #158
Comments
Okay, I got it working. I subclassed the Auth and Admin classes and just overrid some methods as follows (VG is the name of my website):
The result is that I now need to login using LinkedIn, then go to the admin login page, enter any credentials (anything will work, since it only checks if the user already logged in using LinkedIn) and hit enter. Although not ideal, it does work now.. :) If you think there's anything wrong with this way of doing it, I would be very happy to know! If not; thanks for creating peewee, it's the best Python ORM out there! |
Thanks for posting your findings, I think your approach looks sane but not knowing your application as well as you do, I'm not sure I can comment on how correct things are. Good luck and glad you're enjoying working with peewee! |
One last question: is there a way to change the admin base url from |
I believe when instantiating your admin = Admin(app, auth, prefix='/my-awesome-peewee-admin) |
That's what I thought as well, but it doesn't seem to work. Also, the default seems to be |
Hmm...I'm not sure why that isn't working. |
the prefix tag works just fine. i moved my admin with that syntax. I also used subdomain='name' and then it would become name.domain.com. so im not sure what you are doing wrong. coleifer just did a flask blueprint for /admin so if you need to did deeper read about flask blueprints. |
In response to the issue I opened yesterday here I just now see that peewee-admin is not part of peewee, but rather of flask-peewee.
So in order to not get in the way with peewee-admin, I renamed my own User class to something different, but I now get an error saying
no such table: user
. I suppose I need to do a.create_table()
on the User class which is defined here, but I wouldn't know when and where to run that.create_table()
. Furthermore, I suppose I would also need to insert a user in the user table, but for this I also wouldn't know when and where?Are there any docs that describe this, or would you otherwise explain me here how I could do that? All tips are welcome!
The text was updated successfully, but these errors were encountered: