Remove requirements for user to input REDIS config manually.

This commit is contained in:
Oliver Gwyther 2024-04-15 22:27:51 +01:00
parent e64e1099bc
commit bdd85730b5

View File

@ -64,13 +64,11 @@ sed -i "s/'HOST': '',/'HOST': 'localhost',/g" configuration.py
# Prompt user to enter ALLOWED_HOSTS, REDIS, and SECRET_KEY
echo "Please enter manually input the following inforation..."
read -p "Enter ALLOWED_HOSTS (separated by commas): " ALLOWED_HOSTS
read -p "Enter REDIS server (usually 'localhost'): " REDIS
read -p "Enter SECRET_KEY: " SECRET_KEY
# Parse user input into configuration.py
echo "Parsing the entered information to configuration.py..."
sed -i "s/ALLOWED_HOSTS = \[\]/ALLOWED_HOSTS = \[$ALLOWED_HOSTS\]/g" configuration.py
sed -i "s/REDIS = {}/REDIS = {'HOST': '$REDIS', 'PORT': 6379, 'PASSWORD': '', 'DATABASE': 0}/g" configuration.py
sed -i "s/SECRET_KEY = ''/SECRET_KEY = '$SECRET_KEY'/g" configuration.py
# Perform initial database migration