54 lines
1.1 KiB
Markdown
54 lines
1.1 KiB
Markdown
# Flask Base Application
|
|
|
|
A simple Flask web application with user authentication features.
|
|
|
|
## Installation
|
|
|
|
```bash
|
|
# Clone the repository
|
|
git clone https://git.leoan.se/andreas/flask-base.git
|
|
cd flask-base
|
|
|
|
# Create and activate virtual environment (recommended)
|
|
python -m venv venv
|
|
source venv/bin/activate # On Linux/MacOS
|
|
# venv\Scripts\activate # On Windows
|
|
|
|
# Install dependencies
|
|
pip install flask flask-sqlalchemy flask-login werkzeug
|
|
|
|
# Initialize database
|
|
flask init-db
|
|
```
|
|
|
|
## Usage
|
|
|
|
### Local Development
|
|
```bash
|
|
# Start development server
|
|
flask run --host=0.0.0.0 --port=5001
|
|
|
|
# Optional: Kill any existing flask server first
|
|
pkill -f "flask run" && flask run --host=0.0.0.0 --port=5001
|
|
```
|
|
|
|
### Docker Deployment
|
|
```bash
|
|
# Build and start container
|
|
docker-compose up --build
|
|
|
|
# For production (detached mode)
|
|
docker-compose up --build -d
|
|
```
|
|
|
|
The application will be available at `http://localhost:5001`
|
|
|
|
### Persisting Data
|
|
The database will be preserved between container restarts through the `./instance` volume mount.
|
|
|
|
## Features
|
|
- User registration with password confirmation
|
|
- Secure password hashing
|
|
- Login/logout functionality
|
|
- SQLite database
|