/AuthenticationSystemUsingFlask

An authentication system using flask to login anmd signup users.

Primary LanguagePython

Flask Authentication System

This is open-source and can be used by anyone.For any suggestions,bugs found,cleaner and better code,more functionality,please contribute to this repository.

Key Features:

Unique Username,Email and Mobile Address
Email Validator
Email Verification
Account Activated email is sent if the account email is verified
Forgot Password Functionality
Encrypted Password
Mobile Verification by sending OTP via message using the Twilio API

Gmail Mail Config

Go to your registered gmail account,in 'myaccount' go to 'app password' and create an app with the name of your website.The Password received can be either stored as an environment variable along with the email and hence this process can help you access the email functionality.
GMail Account => MyAccount => App Passwords => Create App => Store The Password/Key Provided => Use the stored Key

(Also add to config.py)
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 587
MAIL_USE_TLS = True
MAIL_USE_SSL = False
MAIL_USERNAME = os.environ.get('EMAIL_USER')
MAIL_PASSWORD = os.environ.get('Authentication_Pwd')

Twilio Config

Go to Twilio API,create account,generate number, store and use SID and Token.

Requirements

A version of python
pip package manager installed
Local instance of MySQL running on localhost as user root
Set MySQL password as an environment variable as 'MYSQL_PWD'
Run queries.sql
pip install flask
pip install mysqlclient
pip install flask-mysqldb
pip install flask-WTF
pip install passlib
pip install twilio

Quick Start

# Clone the repository
git clone https://github.com/yashjhaveri05/AuthenticationSystemUsingFlask.git

Create a file called config.py that looks like

import os

DEBUG = True
TESTING = True
MYSQL_HOST = 'localhost'
MYSQL_USER = 'root'
MYSQL_PASSWORD = os.getenv('MYSQL_PWD')
MYSQL_DB = 'course'
MYSQL_CURSORCLASS = 'DictCursor'
SECRET_KEY = 'your_secret_key'

Go to the directory where you cloned the repository

Run

python app.py

Runs the app in the development mode.