mirror of
				https://github.com/StefBuwalda/cal_counter.git
				synced 2025-10-30 11:19:59 +00:00 
			
		
		
		
	Add base Flask application with user authentication, SQLAlchemy models for users, units, and food items, admin blueprint, and basic templates. Includes database migration setup, login form, and seed script for initial user creation.
		
			
				
	
	
		
			19 lines
		
	
	
		
			514 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			514 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from flask import Flask
 | |
| from flask_login import LoginManager  # type: ignore
 | |
| from flask_sqlalchemy import SQLAlchemy
 | |
| from flask_migrate import Migrate
 | |
| from application.admin.routes import admin_bp
 | |
| 
 | |
| 
 | |
| app = Flask(__name__)  # Init Flask app
 | |
| app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///data.db"
 | |
| 
 | |
| 
 | |
| db = SQLAlchemy(app=app)  # Init SQLAlchemy
 | |
| migrate = Migrate(app=app, db=db)  # Init Migration
 | |
| 
 | |
| login_manager = LoginManager(app=app)  # Init login manager
 | |
| 
 | |
| # Register blueprints
 | |
| app.register_blueprint(admin_bp)
 |