mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-29 19:00:00 +00:00
Initial commit: Flask calorie counter app setup
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.
This commit is contained in:
18
application/__init__.py
Normal file
18
application/__init__.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user