Skip to content

roshisoftsol/flask-script-starter

Repository files navigation

Flask-User starter app

This code base serves as a great starting point to write your next Flask application
(With or without Flask-User)

Developer benefits

  • Tested on Python 2.7, 3.3, and 3.4
  • Well organized directories with lots of comments
    • app/models
    • app/startup
    • app/views
  • HTML5 BoilerPlate / jQuery / Bootstrap layout template
  • Few dependencies (Flask-SQLAlchemy, Flask-WTF, Flask-User, Flask-Migrate)
  • Includes Flask-User user management
    • Register, Confirm email, Login, Logout
    • Change username/email/password, Forgot password
  • SMTPHandler for error-level log messages -- sends emails on unhandled exceptions
  • Includes py.test test framework
  • Includes alembic database migration framework

Cloning the code base

We assume that you have git and virtualenvwrapper installed.

# Clone the code repository into ~/dev/my_app
mkdir -p ~/dev
cd ~/dev
git clone https://github.com/lingthio/Flask-User-starter-app.git my_app

# Create the 'my_app' virtual environment
mkvirtualenv -p PATH/TO/PYTHON my_app

# Install required Python packages
cd ~/dev/my_app
workon my_app
pip install -r requirements.txt

Initializing the Database

# Create DB tables and populate the roles and users tables
python manage.py first_time_setup

Running the app

# Start the Flask development web server
python manage.py runserver

Point your web browser to http://localhost:5000/

You can make use of the following users:

  • email user@example.com with password password1.
  • email admin@example.com with password password1.

Database migrations

# Show all DB migration commands
python manage.py db

See the Alembic docs for more information.

Trouble shooting

If you make changes in the Models and run into DB schema issues, delete the sqlite DB file app/app.sqlite.

Acknowledgements

With thanks to the following Flask extensions:

Flask-User-starter-app was used as a starting point for this code repository.

# Please consider leaving the line above in your project's README file. Thank you.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published