A Simple Authentication System Project with basic user functionality in Python Flask with SQLAlchemy.
- Create an account
- Log In via username or email
- Social login with Google OAuth
- Log out effortlessly
- Email verification for account activation
- Reset password via secure link
- Update email with confirmation link
- Edit profile details and upload a profile image
- Change password anytime after log in
- Set new theme preferences
- Flask
- Flask-Login
- Flask-SQLAlchemy
- Flask-WTF
- Flask-Mail
- Flask-Migrate
- Flask-Limiter
- Bootstrap-Flask
- Authlib
- Jinja2
For local (without Docker) setup, you’ll need:
-
pip (Python package installer)
-
PostgreSQL / SQLite (depending on your DB setup ignore if using docker)
Make sure to also have:
-
A
.env
file with required environment variables (see.env.example
) -
Access to required API keys or credentials (e.g., for Flask-mail, OAuth logins, Google re-captcha)
git clone https://github.com/anuraagnagar/flask-user-authentication.git
cd flask-user-authentication
Note: To run this project, you will need to change
.env.example
file to.env
on base directory and set the environment variables.
You can run this project with Docker. For that, you need to have Docker installed and running on your machine.
To run the project with Docker, follow these steps:
docker compose -f docker/docker-compose-local.yml up
On Windows
python -m venv venv
venv\scripts\activate
On MacOS/Linux/Unix
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Note: In some cases, the flask db
command might not appear until the application is started with flask run
command. Make sure to run this command before proceeding with any database migrations.
Initialize the database migration directory.
flask db init
Run migrate command.
flask db migrate -m "initial_migration"
Upgrade the database for latest migration.
flask db upgrade
Create a Initial Test User for our application.
flask createtestuser
Once the database is set up, you can run the Flask server to start your application.
flask run
To access this application open http://localhost:5000
in your web browser.
Contributions are welcome! If you find a bug or want to add a new feature, please open an issue or submit a pull request. For more information checkout CONTRIBUTING.md
By contributing to this project, you agree that your contributions will be licensed under the MIT License.