This guide will help you set up and run a Flask web application.
Before you begin, make sure you have the following installed on your system:
- Python (>= 3.6)
-
Clone the project repository (if you haven't already):
git clone <repository-url> cd <project-directory>
-
Create a virtual environment (recommended):
python -m venv venv
-
Activate the virtual environment:
-
On Windows:
venv\Scripts\activate
-
On macOS and Linux:
source venv/bin/activate
-
-
Install project dependencies:
pip install -r requirements.txt
-
Initialize the database (SQLite) and migrations:
flask db init
-
Create the initial migration:
flask db migrate -m "Initial database setup"
-
Apply the migration to create the database tables:
flask db upgrade
-
Start the Flask development server:
python run.py
-
Open a web browser and navigate to http://localhost:5000 to access the application.