added scripts and req.txt
This commit is contained in:
parent
c45793ccc6
commit
f26985b2c3
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
||||
django
|
||||
21
scripts/clear_logs.sh
Normal file
21
scripts/clear_logs.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define the log directory path
|
||||
LOG_DIR="./resources/logs/"
|
||||
|
||||
# Check if the directory exists
|
||||
if [ -d "$LOG_DIR" ]; then
|
||||
# If it exists, check if there are any .log files in it
|
||||
if ls "$LOG_DIR"*.log 1> /dev/null 2>&1; then
|
||||
# If there are log files, remove them
|
||||
rm "$LOG_DIR"*.log
|
||||
echo "Log files removed from $LOG_DIR."
|
||||
else
|
||||
# If no log files are found
|
||||
echo "No log files found in $LOG_DIR."
|
||||
fi
|
||||
else
|
||||
# If the directory does not exist, create it
|
||||
mkdir "$LOG_DIR"
|
||||
echo "Directory $LOG_DIR created."
|
||||
fi
|
||||
29
scripts/setup_env.sh
Normal file
29
scripts/setup_env.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status.
|
||||
set -e
|
||||
|
||||
# Create the virtual environment in the current directory
|
||||
echo "Checking to see if virtual environment exists..."
|
||||
if [ -d .venv ]; then
|
||||
# echo "Virtual environment already exists. Please delete it before running this script."
|
||||
# exit 1
|
||||
echo "Virtual environment already exists. Skipping creation."
|
||||
else
|
||||
echo "Virtual environment does not exist. Creating..."
|
||||
python3.12 -m venv .venv
|
||||
echo "Virtual environment created."
|
||||
fi
|
||||
# python -m venv .venv
|
||||
|
||||
# Activate the virtual environment
|
||||
source .venv/bin/activate
|
||||
|
||||
# Install the required packages from the requirements.txt file
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Upgrade pip
|
||||
pip install --upgrade pip
|
||||
|
||||
# Print a success message
|
||||
echo "Virtual environment created and requirements installed successfully."
|
||||
Loading…
Reference in New Issue
Block a user