This code base serves as starting point for writing your next Flask application.
- Well organized directories with lots of comments
- app
- commands
- models
- static
- templates
- views
- tests
- app
- Includes test framework (
py.test
andtox
) - Includes database migration framework (
alembic
) - Sends error emails to admins for unhandled exceptions
We assume that you have git
and virtualenv
installed.
cd ~
virtualenv env
. env/bin/activate
mkdir -p ~/www/my_app
cd www
git clone https://github.com/Alexmod/Flask-User-and-Flask-admin.git my_app
cd my_app/
pip install -r requirements.txt
Edit the local_settings.py
file.
Specifically set all the MAIL_... settings to match your SMTP settings
Note that Google's SMTP server requires the configuration of "less secure apps". See https://support.google.com/accounts/answer/6010255?hl=en
Note that Yahoo's SMTP server requires the configuration of "Allow apps that use less secure sign in". See https://help.yahoo.com/kb/SLN27791.html
# Create DB tables and populate the roles and users tables
python manage.py init_db
# Or if you have Fabric installed:
fab init_db
# Start the Flask development web server
python manage.py runserver
# Or if you have Fabric installed:
fab runserver
Point your web browser to http://localhost:5000/
You can make use of the following users:
- email
[email protected]
with passwordPassword1
. - email
[email protected]
with passwordPassword1
.
# Start the Flask development web server
py.test tests/
# Or if you have Fabric installed:
fab test
If you make changes in the Models and run into DB schema issues, delete the sqlite DB file app.sqlite
.