working base site setup with gatekeeping working

This commit is contained in:
JakeBreath
2026-08-03 12:43:33 -05:00
parent 2764644d8b
commit 85e6241ad4
37 changed files with 1146 additions and 58 deletions
Executable
+32
View File
@@ -0,0 +1,32 @@
#!/bin/bash
# Development startup script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DJANGO_DIR="$SCRIPT_DIR/nonpacks"
PYTHON_BIN="$SCRIPT_DIR/venv/bin/python"
FLAG_FILE="$SCRIPT_DIR/.migrations_done"
FORCE_SETUP=0
# Check for --force-setup argument
for arg in "$@"; do
if [ "$arg" = "--force-setup" ]; then
FORCE_SETUP=1
fi
done
cd "$DJANGO_DIR"
# Run migrations once, flag it, skip next time
if [ ! -f "$FLAG_FILE" ] || [ $FORCE_SETUP -eq 1 ]; then
echo "Running database migrations..."
"$PYTHON_BIN" manage.py migrate
touch "$FLAG_FILE"
echo "Migrations applied. Flag file created: $FLAG_FILE"
else
echo "Database already migrated (found $FLAG_FILE). Skipping."
echo "To force re-run, use: $0 --force-setup"
fi
echo "Starting Django development server on 0.0.0.0:8000..."
exec "$PYTHON_BIN" manage.py runserver 0.0.0.0:8000