This is a Flask application that demonstrates user authentication using Flask, Flask-Login, and SQLAlchemy. Simple flask authentication using werkzeug
- Clone the repository:
git clone https://github.com/loading04/Flask_auth.git2.Navigate to the project directory:
cd Flask_auth
- Install the required dependencies:
pip install -r requirements.txt- Run the application:
python app.py
Once the application is running, you can access it by navigating to http://localhost:5000 in your web browser.
/ - Home page
/register - User registration page
/login - User login page
/secrets - Protected route that displays user information
/logout - Logout route
/download - Route to download a file (cheat_sheet.pdf)
The application can be configured by modifying the following variables in the code:
SECRET_KEY - Secret key used for session encryption
SQLALCHEMY_DATABASE_URI - URI for the SQLite database file
SQLALCHEMY_TRACK_MODIFICATIONS - Tracks modifications to database models. Set to False to improve performance
The application uses a SQLite database to store user information. The database schema is defined by the User class in the code. The table will be created automatically the first time the application is run. You can uncomment the db.create_all() line to create the table manually.
The application relies on the following dependencies:
Flask
Flask-Login
SQLAlchemy
Werkzeug