26 lines
714 B
Bash
Executable File
26 lines
714 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "=== Installing local plugin (editable) ==="
|
|
uv pip install -e /opt/netbox-plugin-services
|
|
|
|
echo "=== Running migrations ==="
|
|
python manage.py migrate --no-input
|
|
|
|
echo "=== Collecting static files ==="
|
|
python manage.py collectstatic --no-input
|
|
|
|
echo "=== Creating superuser ==="
|
|
python manage.py shell -c "
|
|
from django.contrib.auth import get_user_model
|
|
User = get_user_model()
|
|
if not User.objects.filter(username='admin').exists():
|
|
User.objects.create_superuser('admin', 'admin@example.com', 'admin')
|
|
print('Superuser admin created (password: admin)')
|
|
else:
|
|
print('Superuser admin already exists')
|
|
"
|
|
|
|
echo "=== Starting dev server ==="
|
|
python manage.py runserver 0.0.0.0:8000
|