-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
30 lines (25 loc) · 809 Bytes
/
build.sh
File metadata and controls
30 lines (25 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env bash
# Exit on error
set -o errexit
echo "===== Installing dependencies ====="
pip install -r requirements.txt
echo "===== Collecting static files ====="
python manage.py collectstatic --noinput
echo "===== Running migrations ====="
python manage.py migrate
echo "===== Creating superuser if needed ====="
python manage.py shell -c "
from accounts.models import User
if not User.objects.filter(role='admin').exists():
User.objects.create_superuser(
username='admin',
email='admin@smsportal.com',
password='Admin@123456',
full_name='System Administrator',
role='admin'
)
print('Admin user created: admin / Admin@123456')
else:
print('Admin user already exists')
" || echo "Superuser creation skipped"
echo "===== Build complete ====="