Flask Authentication Project
A simple Flask application demonstrating authentication, SQLAlchemy ORM, and a REST API. Links & Resources:
- User authentication (login/register/logout)
- Public and protected routes
- SQLite database with SQLAlchemy ORM
- REST API endpoint for users
- Bootstrap-styled templates
- Create a virtual environment:
python -m venv venv
- Activate the virtual environment:
- Windows:
venv\Scripts\activate
- Unix or MacOS:
source venv/bin/activate
- Install requirements:
pip install -r requirements.txt
- Run the application:
python run.py
/
- Public homepage/private
- Protected route (requires login)/api/users
- API endpoint listing all users/login
- User login/register
- User registration/logout
- User logout
Get list of all users:
curl http://localhost:5000/api/users
This is a demonstration project. In a production environment, you should:
- Use a proper secret key
- Enable HTTPS
- Implement proper password validation
- Add rate limiting
- Use environment variables for sensitive data