This repository contains a simple login system built with Flask and SQLite. It allows users to register for an account, log in, and log out.
To run this project locally, follow these steps:
-
Clone the repository to your local machine using the following command:
git clone https://github.com/your-username/simple-login-system.git
-
Navigate to the project directory:
cd simple-login-system
-
Create a virtual environment to isolate the project's dependencies:
python -m venv env
-
Activate the virtual environment:
-
On macOS and Linux:
source env/bin/activate
-
On Windows:
.\env\Scripts\activate
-
-
Create the SQLite database:
flask init-db
-
Run the Flask development server:
flask run
-
Open your web browser and visit
http://localhost:5000
to access the application.
This Flask application allows users to register for an account, log in, and log out. Here are the available routes:
/register
: Allows users to register for an account./login
: Allows users to log in to their account./logout
: Allows users to log out of their account./dashboard
: A protected route that only logged-in users can access.
When a user registers for an account, their information is stored in the SQLite database. When they log in, their credentials are checked against the database. If they are valid, they are redirected to the dashboard.
If a user tries to access the dashboard without being logged in, they are redirected to the login page.
This is a simple example of how to build a login system using Flask and SQLite. You can customize it further based on your project's requirements.
This project is licensed under the MIT License.
If you have any questions or suggestions, feel free to contact us at email@example.com.