-
Notifications
You must be signed in to change notification settings - Fork 3
Initial Setup: Linux
If you haven't already, please follow the SRCT initial setup instructions for Linux to install the prerequisite software.
Open the terminal and navigate to your SRCT projects directory.
Install the latest Python3 using your distro's package manager (apt
is used here, but other systems may use yum
or dnf
):
sudo apt install python
Next, install Virtualenv using pip, the Python package manager. Virtualenv lets us install dependencies for each project individually, instead of installing them system wide.
pip install virtualenv
In your SRCT projects directory, run the following command to clone the Go codebase to your machine
git clone git@github.com:srct/go.git
Run cd go
to enter into the project directory.
In the go
project directory, create a virtualenv by running the command virtualenv .venv
. Next, activate it by running source .venv/bin/activate
. Always make sure to activate the virtualenv before starting work on Go. Deactivate at any time by running the deactivate
command.
With the virtualenv activated, run pip install -r requirements.txt
to install the Python dependencies.
Login to MySQL by running mysql -u root -p
, then entering root
as the password and hitting enter. Run the following commands:
CREATE DATABASE go;
CREATE USER 'go'@'localhost' IDENTIFIED BY 'go';
GRANT ALL PRIVILEGES ON go.* TO 'go'@'localhost';
FLUSH PRIVILEGES;
This will create the Go database and a corresponding user which is then granted the appropriate privileges.
Exit MySQL, then run the following commands:
python go/manage.py makemigrations
python go/manage.py migrate
This will run the database migrations, which setup the MySQL database to the proper state.
Finally, run this to start the Go development server:
python go/manage.py runserver
Navigate in your web browser to http://127.0.0.1:8000 to see Go in action!