bakerx run so.io focal --ip 192.168.100.120
whoami
Install prereqs.
sudo apt-get update
sudo apt install python3-pip -y
sudo apt install postgresql postgresql-client -y
cd /opt
sudo git clone https://bitbucket.org/laserllama/sourceoptics.git
cd /opt/sourceoptics
sudo mkdir -p /etc/source_optics/conf.d/
sudo pip3 install -r requirements.txt
Once PostgreSQL is installed, make a new user and database:
sudo -u postgres createuser {{user}} -s
sudo -u postgres createdb source_optics
sudo -u postgres psql << 'END_DOC'
ALTER DATABASE source_optics OWNER TO {{user}};
END_DOC
sudo -u postgres psql << 'END_DOC'
CREATE ROLE sourceoptics WITH LOGIN;
ALTER ROLE vagrant PASSWORD '{{pass}}';
END_DOC
Create database file.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'USER': '{{user}}',
'NAME': 'source_optics',
'HOST': '127.0.0.1',
'PASSWORD' : '{{pass}}',
}
}
Allow all addresses as valid server hosts.
ALLOWED_HOSTS = ['*']
cd /opt/sourceoptics
sudo python3 manage.py migrate
sudo python3 manage.py createsuperuser
sudo python3 manage.py generate_secret
cd /opt/sourceoptics
python3 manage.py runserver 0:8000