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

Find easier way to create first admin #15

Closed
sandlerben opened this issue Oct 21, 2015 · 3 comments
Closed

Find easier way to create first admin #15

sandlerben opened this issue Oct 21, 2015 · 3 comments

Comments

@sandlerben
Copy link
Contributor

See discussion at hack4impact-upenn/women-veterans-rock#1

@abhisuri97
Copy link
Contributor

Does this still need work?

@sandlerben
Copy link
Contributor Author

I think this is fine. Maybe we can merge the approach used by cac into flask-base

Each team can set an admin account which is always created when they call setup_dev. For example, for GPCAH, we had an account ben@ben.com with password password.

@sandlerben sandlerben removed the ready label Apr 7, 2016
@abhisuri97
Copy link
Contributor

abhisuri97 commented Jul 7, 2016

Fairly easy way to do this (already in the application):
python manage.py runserver.
Go to Register. Create an account with an email matching ADMIN_EMAIL found in config.py
Make sure that python manage.py setup_dev has been called first

OR

Start an app shell.
python manage.py shell
Create user instance with email = ADMIN_EMAIL found in config.py

>>> admin = User(email = "flask-base-admin@example.com", password="something", confirmed=1)
>>> db.session.add(admin)
>>> db.session.commit()

Administrator is created provided setup_dev() was called and roles were initialized.

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

No branches or pull requests

2 participants