Before you start, you will need to have:
Once you have these, you proceed with the steps below to set up the project.
-
Go to https://repo.code.ubc.ca/. You should see an option for "team_formation". Select this.
You should already have access to this repository.
-
A warning should display at the top of your window, resolve this by creating and adding your SSH key to your Gitlab account.
You can check if there's an existing key and just add that.
If not, generate one and then add it. Here is a helpful guide for how to do that -
Clone the repo onto your local machine. You will need to be connected to the UBCO vpn for this and future git commands to work.
MacOS: Use the "Clone with SSH" option.
Windows: You might need to use "Clone with HTTPS" instead.Regardless of the approach, open your terminal and type:
git clone <REPO_LINK>where<REPO_LINK>is the link given by either cloning option. -
Open the project with PyCharm.
- You may be prompted to "trust" the project, core features in PyCharm will be locked until you trust the project.
- Pycharm should configure an interpreter (bottom right-hand corner) that shows a virtual environment for this
project (e.g., 'Python 3.7 (team_formation)').
If this is not done automatically (i.e., there is no
/venv/directory in the project), create a new virtual environment for this project. - PyCharm should run
pip install -r requirements.txtautomatically, but run this manually in your terminal if you notice errors about uninstalled packages. - Resolve any issues. *
-
Get the
.envfile from someone on the project already (or from the project discord's server under "Notes/Resource") .- Place this in your project's root directory.
-
Start docker on your machine. It must be running in the background for further steps to be completed.
-
Run the project.
- In a terminal, run
docker-compose up -d --build. This builds all the containers. - To run the project, run
docker-compose up. If this works, docker should have the project running. - You may need to manually run migrations with
docker exec -it team_formation_app_1 python manage.py migrate
- In a terminal, run
-
PyCharm's terminal should show the localhost address for the site. Click that address and run the project locally on your browser.
-
In the repo, look up the file
quick_start.mdand read it.- Follow the instructions there to create a super user with
username=123andpassword=password, and leave email blank (just hint enter when it prompts for email).It will consider
'password'a weak password, so typeywhen it prompts to override the password validation process. - Follow instructions to create a course with
CANVAS_COURSE_ID=31084andname=sandboxcoursefor reference later. - Create an instructor by running:
docker exec -it team_formation_app_1 python manage.py update_user 123Note that
123here is a reference to the username of the superuser you created earlier. - Follow the instructions to give
CANVAS_USER_ID=123permissions toCANVAS_COURSE_ID=31084. - Follow the instructions to set the access token for
CANVAS_USER_ID=123to the access token you retrieve.You can create a new Canvas access token by logging onto Canvas, then click 'Settings'.
Generate a new access token. You may want to write this down somewhere private and keep a record of it.
- Follow the instructions there to create a super user with
-
Navigate to
localhost:8000in your browser and log in with the following credentials:Username:
123
Password:password -
Navigate to
localhost:8000/courses/31084/sectionsand use the interface to import course data.
This should work as long as you are added with the correct user permissions to the sandbox course (
id=31084), and your Canvas access token has been set up correctly.