michaldaniel / flask-registration

Home Page:https://realpython.com/blog/python/handling-email-confirmation-in-flask/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flask Registration

Build Status

Starter app for managing users - login/logout, registration, and email confirmation.

Blog posts:

QuickStart

Set Environment Variables

Development Example (with Debug Mail):

$ export APP_SETTINGS="project.config.DevelopmentConfig"
$ export APP_MAIL_SERVER=debugmail.io
$ export APP_MAIL_PORT=25
$ export APP_MAIL_USE_TLS=true
$ export APP_MAIL_USE_SSL=false
$ export APP_MAIL_USERNAME=ADDYOUROWN
$ export APP_MAIL_PASSWORD=ADDYOUROWN

Production Example:

$ export APP_SETTINGS="project.config.ProductionConfig"
$ export APP_MAIL_SERVER=ADDYOUROWN
$ export APP_MAIL_PORT=ADDYOUROWN
$ export APP_MAIL_USE_TLS=ADDYOUROWN
$ export APP_MAIL_USE_SSL=ADDYOUROWN
$ export APP_MAIL_USERNAME=ADDYOUROWN
$ export APP_MAIL_PASSWORD=ADDYOUROWN

Update Settings in Production

  1. SECRET_KEY
  2. SQLALCHEMY_DATABASE_URI

Create DB

Run:

$ sh create.sh

Or:

$ python manage.py create_db
$ python manage.py db init
$ python manage.py db migrate
$ python manage.py create_admin

Want to clean the environment? Run:

sh clean.sh

Run

$ python manage.py runserver

Testing

Without coverage:

$ python manage.py test

With coverage:

$ python manage.py cov

About

https://realpython.com/blog/python/handling-email-confirmation-in-flask/

License:MIT License


Languages

Language:Python 77.2%Language:HTML 21.6%Language:Shell 1.0%Language:CSS 0.1%Language:JavaScript 0.0%