-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
40 lines (29 loc) · 997 Bytes
/
dev.sh
File metadata and controls
40 lines (29 loc) · 997 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
31
32
33
34
35
36
37
38
39
#!/bin/bash
set -e
# This script sets a development environment in demo mode (using SQLite).
# Clean all the media files
rm -rf ./media/*
rm -rf ./db.sqlite3
# Set demo mode environment variable
export DEMO=True
echo "Running in DEMO mode with SQLite database."
# Configure the Django settings for testing
echo "Setting up the database..."
python manage.py makemigrations
python manage.py migrate --noinput
echo "Loading initial data..."
python manage.py loaddata initial_data.json
# Create a superuser for testing
echo "Creating superuser..."
export DJANGO_SUPERUSER_USERNAME=admin
export DJANGO_SUPERUSER_EMAIL=admin@example.com
export DJANGO_SUPERUSER_PASSWORD=admin
python manage.py createsuperuser --noinput
# Create test users
echo "Generating test users..."
python manage.py generate_users
echo "Collecting static files..."
python manage.py collectstatic --noinput
# Start the Django development server
echo "Starting the Django development server..."
python manage.py runserver