Skip to content

Teamable-Analytics/teamable-backend

Repository files navigation

Teamable: Backend

Getting started

For local development

Prerequisites:

  • Python 3.11
  • Note: Docker is not needed for local development

Installation:

  1. Clone this project.
     git clone [email protected]:Teamable-Analytics/teamable-backend.git
  2. Install all dependencies.
    python3 -m pip install -r requirements.txt
  3. Create local environment file from sample.
    cp sample.env .env
  4. (Optional) Create and activate virtual environment.
    python3 -m venv venv
    source venv/bin/activate
  5. Apply database migrations.
    python manage.py migrate
  6. Run the project from within the src directory with:
    python3 manage.py runserver

Project Setup (only needs to be run the first time the project is run):

  1. Create a superuser in Django
    python3 manage.py createsuperuser
    Then follow the steps as prompted in the terminal.
  2. Log in to localhost:8000/admin using your superuser credentials.
  3. Create an Organization in the admin dashboard. Use the following details:
    • Name: (anything you want)
    • LMS Type: Canvas
    • LMS API URL: https://canvas.ubc.ca (do not add a / as the end of this URL)
  4. Create a Course in the admin dashboard. Use the following details:
    • Name: (anything you want)
    • Organization: (the organization from Step 3 above)
    • LMS Access Token: (leave blank)
    • LMS Course ID: 31084
    • LMS Opt-in Quiz ID: (leave blank)
    • Grade book Attribute: (leave blank)
  5. Populate your course's LMS Access Token.
    • Follow this guide.
    • Copy your LMS access token into the Course using the admin dashboard.
  6. Create a normal instructor user.
    1. In the admin dashboard, create a CourseMember with the following details:
      • User: (leave blank)
      • Sections: (leave untouched)
      • Course: (the course you created in Step 4 above)
      • Role: Instructor
      • First name: (leave blank)
      • Last name: (leave blank)
      • LMS ID: (leave blank)
      • SIS User ID: (leave blank)
    2. Create a sign up token for this CourseMember.
      1. Go to http://localhost:8000/admin/app/coursemember/
      2. Select the checkbox for the CourseMember created in Step 6.i.
      3. In the "Action:" dropdown, select "Create JWT for..." and click "Go".
      4. You will see a page with raw JSON. It will have 1 key (likely 1) and the value of that key will be a string. This string is the token.
    3. Follow the README in Teamable Frontend to attach login credentials to this CourseMember. The token from above is the "Instructor signup token" mentioned in that README.

Useful commands

Format code using:

python3 -m black .

Resources

About

Backend powering the Teamable web application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages