-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstartup.sh
More file actions
28 lines (23 loc) · 763 Bytes
/
startup.sh
File metadata and controls
28 lines (23 loc) · 763 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
#!/bin/bash
# Define the path to your virtual environment and Django project
VENV_PATH="/home/<USERNAME>/env"
PROJECT_PATH="/home/<USERNAME>/FarmInsight-FPF-Backend/django_server"
# Activate the virtual environment
if [ -d "$VENV_PATH" ]; then
source "$VENV_PATH/bin/activate"
echo "Virtual environment activated."
else
echo "Virtual environment not found. Make sure the path is correct."
exit 1
fi
# Navigate to your Django project directory
if [ -d "$PROJECT_PATH" ]; then
cd "$PROJECT_PATH"
else
echo "Django project directory not found. Make sure the path is correct."
exit 1
fi
# Start the Django development server
python manage.py runserver 0.0.0.0:8001
# Deactivate the virtual environment when done (optional)
deactivate