This commit is contained in:
pika 2025-03-22 12:30:45 +01:00
commit acb3c7642a
23 changed files with 3940 additions and 0 deletions

18
init_db.py Normal file
View file

@ -0,0 +1,18 @@
from app import create_app, db
from app.models import User, File, Share, Download
app = create_app()
with app.app_context():
# Create all tables
db.create_all()
# Check if we need to create an admin user
if not User.query.filter_by(username='admin').first():
admin = User(username='admin')
admin.set_password('password') # Change this in production!
db.session.add(admin)
db.session.commit()
print('Admin user created!')
print('Database initialized!')